ans=[-1]*10 for i in range(10): t= [str(i) for _ in range(10)] print(''.join(t),flush=True) x,s=input().split() x=int(x) for j in range(10): t[j] = str((i+1)%10) print(''.join(t),flush=True) y,s=input().split() y=int(y) if x>y and ans[j] == -1: ans[j] = str(i) # print(ans) print(''.join(ans),flush=True) z,s=input().split()