def read(): x, txt = input().split() return int(x) match = 0 ok = [-1] * 10 for i in range(10): tmp = [i if x == -1 else x for x in ok] print(*tmp, sep="") cnt = read() if cnt == 10: exit() found = cnt - match if not found: continue for j in range(10): if tmp[j] == i: tmp[j] = (i + 1) % 10 print(*tmp, sep="") c = read() if c == 10: exit() if c - match == found + 1: ok[j] = tmp[j] if c - match == found - 1: ok[j] = i tmp[j] = i match += found print(*ok, sep="\n")