EOFError: End Of File로 python input이 끝날때 까지 받고 종료하는 조건이다.
while 1: try: print(input()) except EOFError: break
백준 11719번