from subprocess import *
import string

def readuntil(stream,term):
	ret=''
	while True:	
		ch=stream.read(1)				
		ret=ret+ch
		if str(ch)==':':
			return ret


p = Popen('./alienquiz-32',stdin=PIPE,stdout=PIPE)
for i in range(16):
	print(p.stdout.readline().decode()),
#for j in range(5):
while True:
	x=readuntil(p.stdout,': ')
	print('READ {0}'.format(x))
	y=x.split()
	for element in y:
		print element
	n1= long (y[0])
	operator= y[1]
	n2=long (y[2])
	if operator=="+":
		result=n1+n2
	elif operator=="-":
		result=n1-n2
	elif operator=="*":
		result=n1*n2
	elif operator=="/":
		result=n1/n2
	elif operator=="%":
		result=n1%n2	
	print result

	myResult= str(result)+"\n"

	w = p.stdin.write(bytes(myResult))
	p.stdin.flush()
	print(p.stdout.readline().decode()),
while True:
	print(p.stdout.readline().decode()),
