from collections import deque

q = deque()

q.append('a')

n = int(input())

ans_list = []
flag = 0

if n != 1:
    while flag == 0:
#            print(q)
        s = q.pop()
        if len(s) > n:
            flag = 1
        a = list(s)
#        print(s,a)
        x = chr(ord('a')-1)
        while ord(x) != ord(a[len(a)-1])+1:
            x = chr(ord(x)+1)
            y = s + x
            q.appendleft(y)
            if len(y) == n:
                ans_list.append(y)
else:
    ans_list = ['a']

ans_list = sorted(ans_list)

for i in range(len(ans_list)):
    print(ans_list[i])
