public class HelloWorld {
  public static void main(String[] a) {
    Shape[] shapes = new Shape[3];
    shapes[0] = new Shape();
    shapes[1] = new Circle();
    shapes[2] = new Square();
    for (int i = 0; i < 3; i++)
	    shapes[i].draw();
  }
}

class Shape {
  public void draw() {
	  System.out.println("i am a shape");
  }
}
class Circle extends Shape {
  public void draw() {
	  System.out.println("i am a circle");
  }
}

class Square extends Shape {
  public void draw() {
	  System.out.println("i am a square");
  }
}
