import java.rmi.*;

public class MyClient {
  static String hostName="localhost";

  public static void main(String args[]) {
    try {
      MyServer server = (MyServer) Naming.lookup("//"+hostName+"/MyServer");
      int n = server.getDataNum();
      for(int i=0;i<n;++i) {
        System.out.println(server.getData(i));
      }
    } catch (Exception ex) {
      System.out.println(ex);
    }
  }
}