Python Solution of Zhejiang University Online Judge.
for i in xrange(input()):
work(raw_input())
import sys
for line in sys.stdin:
work(line.strip())
try:
while True:
work(raw_input())
except EOFError:
pass
while True:
n = raw_input()
if end_of_data(n):
break
work(n)