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

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

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