n=int(input())

abc='abcdefghijklmnopqrstuvwxyz'

def dfs(keta,s):
  if keta==n:
    global ans
    ans.append(s)
    return

  inx=abc.index(s[-1])
  for i in range(inx+2):
    dfs(keta+1,s+abc[i])

ans=[]
dfs(1,'a')

for i in ans:
  print(i)