import sys input=lambda: sys.stdin.readline().rstrip() import random import sys def ran(x): ret="" for _ in range(x): ret+=str(random.randrange(10)) return ret while True: cur=ran(10) print(cur,flush=True) ct,res=map(str,input().split()) if ct=="10": sys.exit elif ct=="0": zero=cur break else: continue ans="" for i in range(10): for j in range(10): print(zero[:i]+str(j)+zero[i+1:],flush=True) ct,res=map(str,input().split()) if ct=="0": continue else: ans+=str(j) break print(ans,flush=True)