#!/usr/bin/python

from socket import *
from time import ctime

HOST='localhost'
PORT=21658
BUFSIZ=1024
ADDR=(HOST,PORT)

udpCliSock=socket(AF_INET,SOCK_DGRAM)

while True:
    data=input('>')
    if not  data:
        break
    udpCliSock.sendto(data,ADDR)
    data,ADDR=udpCliSock.recvfrom(BUFSIZ)
    if not  data:
        break
    print(data)
udpCliSock.close()