from socket import *
from struct import *

while True:
    st = input(">>> ")
    s = socket(AF_INET, SOCK_STREAM)
    s.connect(("127.0.0.1", 8888))
    s.sendall(pack("!i", len(st.encode())))
    s.sendall(st.encode())
    print(s.recv(len(st)).decode())
    s.close()