import java.util.*;

interface rodent {
  public void reproduce();
  public void runAround();
}

class mouse implements rodent {
  public void reproduce() {
    System.out.println("More mice!");
  }
  public void runAround() {
    System.out.println("mice running!");
  }
}

class gerbil implements rodent {
  public void reproduce() {
    System.out.println("More gerbils!");
  }
  public void runAround() {
    System.out.println("gerbils running!");
  }
}

class hamster implements rodent {
  public void reproduce() {
    System.out.println("More hamsters!");
  }
  public void runAround() {
    System.out.println("hamsters running!");
  }
}

public class ch7ex2 {
  public static void main(String args[]) {
    rodent r[] = {
      new mouse(), new gerbil(), new hamster(),
      new hamster(), new mouse(), new gerbil(),
      new gerbil(), new hamster(), new mouse()
    };
    Vector rv = new Vector();
    for(int i = 0; i < r.length; i++)
      rv.addElement(r[i]);

    for(int i = 0; i < r.length; i++) {
      r[i].reproduce();
      r[i].runAround();
    }
  }
}
  
