import sys
N = int(input())
l = [ord('a')] * N
result = []
result.append(''.join(map(chr,l)))
bin = [0]*N
binMax = 2**(N-1)

def binAdd(i=1):
    if bin[-i]==1:
        bin[-i] = 0
        binAdd(i+1)
    else:
        bin[-i] = 1

def recF():
    binAdd()
    x = 0
    for i in range(N):
        if bin[i] == 1:
            x+= 1
            l[i] = l[i] + x
    result.append(''.join(map(chr,l)))


for i in range(binMax-1):
    l = [ord('a')] * N
    recF()

for s in result:
    print(s)