import sys
sys.setrecursionlimit(1000000)


def dfs(s):
    if len(s) == 0:
        new_s = 'a'
        if len(new_s) != n:
            dfs(new_s)
        else:
            print(new_s)
    else:
        for i in range(ord('a'), ord(s[-1]) + 2):
            new_s = s + chr(i)
            if len(new_s) != n:
                dfs(new_s)
            else:
                print(new_s)


n = int(input())
dfs('')