N = int(input())

alphabets = list('Zabcdefghijklmn')
s = ['a']
ss = []
for i in range(2, N + 1):
    subset = alphabets[1:i + 1]
    for j in range(len(s)):
        for k in subset:
            ss.append(s[j] + k)
    # print('s, ss', s, ss)
    s = ss
    ss = []
for i in s:
    print(i)
