q = deque()

q.append('a')

n = int(input())

ans_list = []

if n != 1:
    for i in range(n-1):
        for j in range(2**i):
            s = q.pop()
            a = list(s)
            b = s + chr(ord(a[len(a)-1]))
            q.appendleft(b)
            if i == n-2:
                ans_list.append(b)
            c = s + chr(ord(a[len(a)-1])+1)
            q.appendleft(c)
            if i == n-2:
                ans_list.append(c)
else:
    ans_list = ['a']

ans_list = sorted(ans_list)

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