import java.net.*;
import java.io.*;

public class Client {
  
  public static void main(String args[]) {
    Socket server;  // our connection to the server
    BufferedReader input;
    PrintStream output;
    String IP_ADDRESS = "153.104.202.116"; // Like a phone number
    int PORT = 5654;                       // Like an extension
    
    try {
      // Call the server (and wait to be connected).
      server = new Socket(IP_ADDRESS, PORT);
      // Define input and output streams to server s
      input = new BufferedReader(
                    new InputStreamReader(server.getInputStream()));
      output = new PrintStream(server.getOutputStream());
      // Write, then read. Without another thread, order is critical.
      output.println("Hello, Server!");
      String response = input.readLine(); // wait for input
      System.out.println("Client got: " + response);
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
}
