import sys a = ['0'] * 10 print('0' * 10) X,S = input().split() X = int(X) if S == 'unlocked':exit() for i in range(10): for j in range(1,10): print('0' * i + str(j) + '0' * (9-i)) x,s = input().split() if s == 'unlocked':exit() x = int(x) if x == X + 1: a[i] = str(j) print(''.join(a))