from itertools import combinations
N = int(input())

ans = [[] for i in range(2**(N-1))]
for i in range(N): #桁
    one_set = 2**(N-1-i)
    counter = 0
    for _ in range(len(ans)//one_set):
        second = _%2
        for j in range(one_set):
            if not ans[counter]:
                ans[counter].append(0)
            else:
                ans[counter].append(ans[counter][-1]+int(second))
            counter += 1
def minus(array):
    m = min(array)
    return [a-m for a in array]
ans = list(set([tuple(minus(a)) for a in ans]))

from collections import Counter
real_ans = []
alr = set()
def syutu(array):
    return tuple(sorted(list(Counter(array).values())))
for a in ans:
    if syutu(a) not in alr:
        alr.add(syutu(a))
        real_ans.append(sorted(a))

def repqqq(array):
    alpha = "abcdefghijklmn"
    temp = []
    for a in array:
        temp.append(alpha[a])
    return "".join(temp)
ans = [repqqq(line) for line in sorted(real_ans)]
for a in ans:
    print(a)
