from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
for i in range(N):
  c = s[:i+1]
  for p in product(s[:i+2],repeat=N-i-1):
    if p and p[0] not in c:
      break
    print(c+"".join(p))
