import sys def maxindex(x): return max(enumerate(x),key=lambda x:x[1])[0] def q(s): print s sys.stdout.flush() return int(raw_input().split()[0]) a=[[]for i in[0]*10] for i in range(10): for j in range(10): s="{0:0>10}".format(j*(10**i)) r=q(s) a[i]+=[r] #print a a=[maxindex(i)for i in a][::-1] print "".join(`i`for i in a)