import itertools

n= int(input())
lis = 'abcdefghijklmnopqrstuvwxyz'
w = lis[:n]
for index,i in enumerate(itertools.product(w, repeat=n)):
  a=''
  for s in i:
    a+=s
  print(a)
  if n == index+1:
    break