ans =["a"]
n =int(input())
for i in range(1,n):
  plus=[]
  for s in ans:
    num=ord(s[-1])-ord("a")+1
    for j in range(num+1):
      plus.append(s+chr(ord("a")+j))
  ans = plus
ans.sort()
for ss in ans:print(ss)
