import sys

N=int(input())
if N==1:
  print("a")
  sys.exit()
  
old_list=[[0]]
for i in range(1,N):
  new_list=[]
  for l in old_list:
    tail=l[-1]
    for k in range(tail+2):
      new_list.append(l+[k])
  old_list=new_list
    
#print(old_list)
llist=["a","b","c","d","e","f","g","h","i","j"]

for ll in old_list:
  #print(ll)
  str_list=[]
  for elm in ll:
    str_list.append(llist[elm])
  print("".join(str_list))