import java.io.*;
import java.net.*;

public class Main {
  public static void main(String args[]) {
    if (args.length < 2) {
      System.err.println("Usage: runme host port");
      return;
    }
    try {
      Socket s = new Socket(args[0], Integer.parseInt(args[1]));
      BufferedReader in = new BufferedReader(new InputStreamReader(
        s.getInputStream()
      ));
      PrintWriter out = new PrintWriter(s.getOutputStream(), true);
      out.println("Player");
      System.out.println("Connected");
      Environment env = new Environment(in, out);
    } catch (IOException e) {
      System.err.println("Problem connecting to the server:");
      System.err.println("");
      e.printStackTrace();
    }
  }
}
