while True:
a = raw_input()
b = raw_input()
if a == '':
break
your code