#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket           

s = socket.socket()     
host = "127.0.0.1"
port = 7770             

s.connect((host, port))
strt = u'{ "text" : "'
end = u'" , "benchmark" : 0 }'

str = raw_input(">>")

while not str == '\q':
	str = strt + str + end
	s.send(str.encode("utf-8"))
	response = s.recv(4096)
	print response.decode("utf-8")
	str = raw_input(">>")
s.close              