# D - String Equivalence
# abc='abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
from itertools import groupby
abc='abcdefghij'
# def dfs(n,s):
#     if n==0:
#         print(s)
#         return
#     for i in range(26):
#     dfs(n-1,s+'a')
n=int(input())
ans=set()
abc=list(abc)
# i：aを使う個数　文字列の種類数
for i in range(1,n+1):
    init_abc=[]
    init_abc=abc[:i]+(n-i)*['a']
    # print(init_abc)
    # l=list(init_abc)
    for l in permutations(init_abc):
        t_str=''
        # print(l)
        l=list(l)
        t_str=''.join(l)
        ans.add(t_str)
    # print('===')
ans=list(ans)
ans.sort()
cnt=set()
for aa in ans:
    if aa[0]=='a':
        print(aa)
