class Cone {
    Circle base;
    double height;
    double volume;
    double surface;
    
    public Cone(Circle base, double height) {
        this.base = base;
        this.height = height;
        this.volume = base.area * height / 3.0;
        this.surface = base.circumference * height + 2 * base.area;
    }
    
    public Cone(double radius, double height) {
        this(new Circle(radius), height);
    }
    
    void setRadius(double radius) {
        base.setRadius(radius);
        this.volume = base.area * height / 3.0;
        double det = Math.sqrt(Math.pow(height, 2) + Math.pow(base.radius, 2));
        this.surface = Math.PI * base.radius * det + base.area;
    }
    
    void setHeight(double height) {
        this.height = height;
        this.volume = base.area * height / 3.0;
        double det = Math.sqrt(Math.pow(height, 2) + Math.pow(base.radius, 2));
        this.surface = Math.PI * base.radius * det + base.area;
    }
    
    void print() {
        base.print();
        System.out.println("height = " + height);
        System.out.println("volume = " + volume);
        System.out.println("surface = " + surface);
    }
}
