class Rectangle{
    private double width, height;

    public void setWidth(double w){
	width = w;
    }

    public void setHeight(double h){
	height = h;
    }

    public double getWidth(){
	return width;
    }
    
    public double getHeight(){
	return height;
    }

    public double area(){
	return width * height;
    }

    public String toString(){
	return "[" + width + ", " + height + "]";
    }
}

class Square extends Rectangle{
    public void setWidth(double w){
	super.setWidth(w);
	super.setHeight(w);
    }

    public void setHeight(double h){
	super.setHeight(h);
	super.setWidth(h);
    }	    
}

public class RectangleDemo{
    public static void main(String[] argv){
	Rectangle r = new Square();
	double w = 3.0;
	double h = 5.0;

	r.setWidth(w);
	r.setHeight(h);

	System.out.println(r.getWidth() * r.getHeight() == r.area());
    }
}

