abstract class Rectangular {
protected int width, height;
int getWidth() { return width; }
int getHeight() { return height; }
}
class Rectangle extends Rectangular {
int setWidth(int w) { width = w; }
int setHeight(int h) { height = h; }
}
class Square extends Rectangular {
int setSize(int s) { width = height = s; }
}