import string
# print(string.ascii_lowercase[:10])
ans = []
N = int(input())

def rec(s):
    if len(s) == N:
        ans.append(s)
        return
    for c in string.ascii_lowercase[:N]:
        rec(s + c)

rec("a")
for x in ans:
    print(x)