ans = ['']*10 for i in range(10): # 0 は 9-i個並べる memo = ['0'] * (9 - i) cnt_max = 0 max_j = -1 for j in range(10): memo.append(str(j)) print(''.join(memo + ans), flush=True) # 結果見る x, s = input().split() if s == 'unlocked': exit() x = int(x) if x > cnt_max: cnt_max = x max_j = j memo.pop() # max_j の時に正しかった ans[-1-i] = str(max_j)