import sysfor x in sys.stdin: x = x.strip() if x != "42": print(x) else: break
1 2 3 42 5
1 2 3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!