n=int(input())

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

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