from string import*
f = lambda n,r=['']:n and r+f(n-1,[x+y for x in r for y in letters+digits])or r

print '\n'.join(f(input()))