#!/usr/bin/env python
import codecs, sys, socket, time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.41.96.121', 8686))
s.setblocking(0)

while 1:
    print s.recv(1024).decode('EBCDIC-CP-BE')
    s.send(sys.stdin.readline().encode('EBCDIC-CP-BE'))
    time.sleep(0.5)

s.close()
