import sys ans = [-1]*10 for i in xrange(10): tmp = 0 out="0"*i+"%d"+"0"*(9-i) for j in xrange(10): print out % j sys.stdout.flush() X,L = raw_input().split() X = int(X) if X == 10: quit() if X > tmp: tmp = X; ans[i] = j print "".join(map(str,ans))