def solve():
    N = int(input())
    
    def dfs(s, s_n):
        if len(s) == N:
            print(s)
        else:
            cp = ord('a')
            for i in range(cp, cp+N):
                dfs(s + chr(i), '')

    dfs('a', '')

solve()