import sys answer = ['0']*10 print('0'*10) sys.stdout.flush() zero, lock = input().split() zero = int(zero) for i in range(10): for j in range(1,10): print('0'*i+str(j)+'0'*(9-i)) sys.stdout.flush() x, lock = input().split() if int(x) > zero: answer[i] = str(j) break elif int(X) < zero: break print(''.join(answer)) sys.stdout.flush() x, lock = input().split() exit()