import copy
def make(n, data):
    out = []
    for i in range(n):
        out.append(data + chr(ord("a") + i))
    return out

n = int(input())
ans = ["a"]
for i in range(1, n):
    tmp = []

    for j in range(len(ans)):
        tmp += make(i + 1, ans[j])
            # print
    if len(tmp) >= 1:
        ans = copy.deepcopy(tmp)

for i in ans:
    print(i)