n = int(raw_input())
while n != 42:
	print n
	n = int(raw_input())