# coding:utf-8 def main(): import random a = str(random.randint(0,9999999999)).zfill(10) # a = '1234567890' print(a) score, s = input().split() if s == 'unlocked': return for i in range(10): for j in range(10): if a[i] == str(j): continue print(a[:i]+str(j)+a[i+1:]) score2, s = input().split() if s == 'unlocked': return if int(score) < int(score2): a = a[:i]+str(j)+a[i+1:] score = score2 break if int(score) > int(score2): break main()