s=['0']*10 for i in range(10): a=[]*10 for j in range(10): s[i]=str(j) print(''.join(s),flush=True) x,res=input().split() if res=='unlocked': exit(0) a[i]=(x,str(j)) a.sort() if a[0][0]!=a[1][0]: s[i]=a[0][1] else: s[i]=a[-1][1]