from itertools import combinations
N = int(input())
import sys
sys.setrecursionlimit(10**6)
ans = []
new = []
from copy import copy
def make(array):
    if len(array) == N:
        ans.append(array)
    else:
        for i in range(array[-1]+2):
            array_ = copy(array)
            array_.append(i)
            make(array_)
make([0])
def repqqq(array):
    alpha = "abcdefghijklmn"
    temp = []
    for a in array:
        temp.append(alpha[a])
    return "".join(temp)
# print(real_ans)
ans = [repqqq(line) for line in sorted(ans)]
for a in ans:
    print(a)
