n = int(input())
ans = ["a"]

for i in range(0,len(ans)):
  while len(ans[i]) < n:
    k = ord(ans[i][-1])
    for j in range(97,k+2):
      ans.append(ans[i] + chr(j))
    del ans[i]

sorted(ans)
for i in range(0,len(ans)):
  print(ans[i])