import itertools
import sys

n = int(input())
S = ['a']*n
while True:
    print("".join(S))
    for i in range(n-1,0,-1):
        if(S[i-1]>=S[i]):
            S[i] = chr(ord(S[i])+1)
            for j in range(i+1,n):
                S[j] = 'a'
            break
    else:
        break