#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**5)
to = "abcdefghij"


def dfs(s, p):
    if len(s) == n:
        print(s)
        return
    if p - 1 >= 0:
        dfs(s + to[p - 1], p - 1)
    if p >= 0:
        dfs(s + to[p], p)
    dfs(s + to[p + 1], p + 1)


n = int(input())
dfs("", -1)
