import java.net.*;
import java.io.*;
import java.util.*;

public class EchoClient{
public static void main(String[] args) throws IOException{
Socket socket = new Socket("localhost", 5000);

PrintWriter out = new PrintWriter(socket.getOutputStream());
Scanner in = new Scanner(System.in);
Scanner inClient = new Scanner(socket.getInputStream());

String message = in.nextLine();
out.println(message);
String reply = inClient.nextLine();
System.out.println(reply);

socket.close();
}
}