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