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