def send_rec(A): S = "".join([str(a) for a in A]) print(S) a,b = input().aplit() if b == "unlocked": exit() a = int(a) return a def send_rec2(A): S = "".join([str(a) for a in A]) ans = "1112223334" a = 0 for i in range(10): if S[i] == ans[i]: a += 1 b = "locked" if a == 10: b = "unlocked" print(a,b) return a X = [] zn = -1 for i in range(10): ret = send_rec([i] * 10) X.append(ret) if ret == 0: zn = i ans = [-1] * 10 if zn == -1: for i in range(1,10): for j in range(10): A = [0] * 10 A[j] = i ret = send_rec(A) if ret == 0: ans[j] = 0 elif ret == 2: ans[j] = i else: for i in range(10): if X[i] == 0: continue for j in range(10): A = [zn] * 10 A[j] = i ret = send_rec(A) if ret == 1: ans[j] = i send_rec(ans)