k='' for i in range(10): g=False c,b=0,0 for j in ['0'*(9-i)+str(x)+k for x in range(10)]: print(j);r=int(input().split()[0]) if r==10: g=True break if c==0: b=r c+=1 continue elif r==b: c+=1 continue k=str(c if r>b else c-1)+k break if g:break