def get(t): if DEBUG: return sum(ti==ai for ti,ai in zip(t,ANS)), ("unlocked" if t==ANS else "locked") else: return input().split() def ask(t): print(t) sys.stdout.flush() a,b = get(t) return int(a),b DEBUG = 0 ANS = "0100000000" import sys from itertools import product ans = [-1]*10 lst = [0]*10 for i in range(10): cnt,ok = -1,-1 for j in range(10): lst[i] = j x,res = ask("".join(map(str,lst))) if res == "unlocked": exit() if x > cnt: cnt = x ok = j ans[i] = ok lst[i] = 0 ask("".join(map(str,ans)))