n = int(input())
cands = set([])

def dfs(count,i):
  if count ==0:
    cands.add(tuple(i))
  for j in range(1,count+1):
    dfs(count-j,i+[j])
dfs(n,[])

from itertools import permutations

ans = []
for c in cands:
  s = ''
  for i in range(len(c)):
    s += chr(97+i)* c[i]
    ans.extend(list(permutations(s,n)))
ans = list(set(ans))
ans.sort()
for i in range(len(ans)):
  for j in range(n):
    if ord(ans[i][j])-97 > j:
      break
  else:
    print(''.join(ans[i]))