n=int(input())

def saiki(l,n):
  for s in l:
    tmp=[]
    for i in range(n):
      tmp.append(s+chr(ord('a')+i))
  return tmp

tmp=['a']
for i in range(1,n):
  tmp=saiki(tmp,i+1)
print(*tmp,sep='\n')