import sys

N=int(input())
def num2alpha(num):
    return chr(97+num)
print(''.join(['a']*N))
for i in range(N-1):
  a=['0']*N
  while True:
    a=[i for i in str(int(''.join(a))+1).zfill(N)]
    print(''.join([num2alpha(int(i)) for i in a]))   
    
    if a[N-i-1]>max(a[:N-i-1]):
      break
      
