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

public class TCPSend {
	public static void main(String args[]) {
		try {
			Socket s =
				new Socket(
					InetAddress.getByName(args[0]),
					Integer.parseInt(args[1]));

			OutputStream os = s.getOutputStream();

			while (true) {
				int i = System.in.read();
				os.write(i);
			}

		} catch (Exception e) {
			System.out.println("Caught " + e);
		}
	}
}
