A=[]
B=["a"]
N=int(input())
if N>1:
 for i in range(N-1):
  A=B
  B=[]
  C=len(A)
  for j in range(C):
   D=ord(A[j][i])-95
   for k in range(D):
    E=A[j]+chr(97+k)
    B.append(E)
for i in range(len(B)):
 print(B[i])