import java.util.*;

class Shape {
    double area(double radius) { return 0; }
    double area(double length, double width) { return 0; }
    double area() { return 0; }
}

class Circle extends Shape {
    double radius;
    Circle(double radius) {
        this.radius = radius;
    }
    @Override
    double area(double radius) {
        return Math.PI * radius * radius;
    }
}

class Rectangle extends Shape {
    double length, width;
    Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }
    @Override
    double area(double length, double width) {
        return length * width;
    }
}

class Square extends Shape {
    double side;
    Square(double side) {
        this.side = side;
    }
    @Override
    double area() {   // ✅ override no-arg version
        return side * side;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String type = sc.next();

        if (type.equals("Circle")) {
            double radius = sc.nextDouble();
            if (radius < 0 || radius > 100) {
                System.out.println("Invalid input");
                return;   // ✅ stop here
            }
            Circle c = new Circle(radius);
            System.out.printf("%.2f\n", c.area(radius));

        } else if (type.equals("Rectangle")) {
            double length = sc.nextDouble();
            double width = sc.nextDouble();
            if (length < 0 || width < 0 || length > 100 || width > 100) {
                System.out.println("Invalid input");
                return;   // ✅ stop here
            }
            Rectangle r = new Rectangle(length, width);
            System.out.printf("%.2f\n", r.area(length, width));

        } else if (type.equals("Square")) {
            double side = sc.nextDouble();
            if (side < 0 || side > 100) {
                System.out.println("Invalid input");
                return;   // ✅ stop here
            }
            Square s = new Square(side);
            System.out.printf("%.2f\n", s.area());

        } else {
            System.out.println("Invalid input");
        }
    }
}
