import sys
sys.setrecursionlimit(100000000)
readline = sys.stdin.readline
from collections import deque

N = int(readline())

alph = 'abcdefghij'

seq = deque()

def dfs(a):
    seq.append(a)
    if len(seq) == N:
        print(''.join([alph[i] for i in seq]))
    else:
        dfs(a)
        if a < N - 1:
            dfs(a + 1)
    seq.pop()

dfs(0)