n = int(input())
anstmp = ["a"]
cnt = 0
for i in anstmp:
  t = ord(i[-1])-95
  if cnt > 100000:
    break
  for j in range(1,t+1):
    anstmp.append(i+chr(j+96))
  cnt += 1
ans = []
for i in anstmp:
  if len(i) == n:
    ans.append(i)
ans.sort()
print(*ans,sep="\n")