for i in range(10): for j in range(10): for k in range(10): s = str(i)+str(j)+str(k) print(s, flush=True) t = str(input()) if t == 'locked': continue else: exit()