from sys import stdin,setrecursionlimit
import string
setrecursionlimit(10**7)
n = int(stdin.readline().rstrip())
alpha = "abcdefghijklmn"
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
    num = 0
    moto = s[:]
    while num == 0:
        flag = False
        for j in s:
            if j in "0123456789":
                s = s.replace(j,alpha[point])
                point += 1
                flag = True
                break
        if flag == False:
            break
    kazu.add(s)
kazu = list(kazu)
kazu.sort()

for i in kazu:
    print(i)