N = int(input())

def dfs(s):
    if(len(s) == N):
        print(s)
        return
    else:
        next_str = chr(ord(s[-1]) + 1)
        pre_str = chr(ord(s[-1]) - 1)
        dfs(s + s[-1])
        dfs(s + next_str)
        if(s[-1] != "a"):
            dfs(s + pre_str)

dfs("a")


