n = int(input())
tb = 'abcdefghijklmnopqrstuvwxyz'
ans = []

def output(s, itb):
    global n
    global tb

    for i in range(n - len(s)):
        t = s + tb[itb] * (i + 1)
        if len(t) == n:
            ans.append(t)
        elif len(t) < n:
            output(t, itb + 1)

output('', 0)
for a in sorted(ans):
    print(a)