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