from sys import stdin,setrecursionlimit
import string
from itertools import combinations_with_replacement
setrecursionlimit(10**7)
n = int(stdin.readline().rstrip())
alpha = "abcdefghijklmn"
kazu = set("")
#0~9までの数字を列挙
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
    moto = s[:]
    while True:
        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)