import string
ans = []
N = int(input())

def rec(s, i):
    if len(s) == N:
        ans.append(s)
        return
    # tmp = set()
    for c in string.ascii_lowercase[:i + 1]:
        # if len(set(s + c)) in tmp:
        #     continue
        # tmp.add(len(set(s + c)))
        rec(s + c, i + 1)

rec("a", 1)
ans.sort()
for x in ans:
    print(x)