# coding:utf-8 def main(): 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()