require 'socket'

host = ARGV[0]
port = ARGV[1].to_i

TCPSocket.open(host, port) { |s|
  while $stdin.gets
    s.write $_
    print s.gets
  end
}
