#!/usr/bin/env python3 import sys key = [None] * 10 class Done(Exception): pass try: for i in range(len(key)): best_n = -1 correct_digit = None for j in range(10): key[i] = j print(''.join([str(c or '0') for c in key])) sys.stdout.flush() n, result = input().split() if result == 'unlocked': raise Done n = int(n) if best_n < n: best_n = n correct_digit = j key[i] = correct_digit except Done: pass