from sys import stdin,setrecursionlimit
import string
setrecursionlimit(10**7)
n = int(stdin.readline().rstrip())
alpha = string.ascii_lowercase
from itertools import combinations_with_replacement
kazu = set()
li = [str(i) for i in range(n)]
lin = list(combinations_with_replacement(li, n))
for i in lin:
    s = ''.join(map(str, i))
    point = 0
    for j in s:
        if j in "0123456789":
            s = s.replace(j,alpha[point])
            point += 1
    kazu.add(s)
kazu = list(kazu)
kazu.sort()
for i in kazu:
    print(i)