for n in range(1, 1001):
	input = lambda: str(n)
	try:
		
		r='0'
		for d in input():r=d+'=+'[r<d]*2+r
		1/eval(r)
		
		print(n)
	except:
		pass