n = int(input())

s = [chr(ord('a') + i ) for i in range(n)]
ans = set()
def dfs(i,now):
  if len(now) == n:
    ans.add(now)
    return
  for j in range(min(0,i-1),n):
    dfs(j+1,now + s[j])

dfs(0,s[0])

ans = sorted(list(ans))
for v in ans:
  print(v)