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