N = int(input())

def dfs(s, mx):
    if len(s) == N:
        print(s)
    else:
        c = 'a'
        for i in range(mx + 1):
            c = chr(ord(c) + i)
            if c == chr(97 + mx):
                dfs(s + c, mx + 1)
            else:
                dfs(s + c, mx)

dfs('', 0)