N = int(input())

s = set()

def solve(n):
    global s

    if n == N:
        return

    if len(s) == 0:
        s.add('a')
        solve(n+1)
    else:
        new_s = set()
        for v in s:
            xc = chr(ord(max(v))+1)
            for vc in v:
                new_s.add(v + vc)
                new_s.add(v + xc)
        s = new_s
        solve(n+1)

solve(0)

print(*s, sep='\n')