n=int(input())
ans=[]
def dfs(s,st):
  if len(s)==n:
    ans.append(s)
    return 
  else:
    for i in range(ord('a'),ord(st)+1):
      dfs(s+chr(i),chr(i+1))
dfs('','a')
ans.sort()
for x in ans:
  print(x)