n = int(input())
lis = ['a','b','c','d','e','f','g','h','i','j','k',]
ans = []
#for i in range(n):
t = ['a'] * n
for i in range(2 ** n):
    s = ['a'] * n
    for j in range(n):
        if ((i >> j) & 1):
            s[n - 1 - j] = 'b'
    ans.append(''.join(s))
ans.append(''.join(t))
for i in range(1,n):
    for j in range(i,n):
        s = ['a'] * n
        s[j:n] = lis[1:n-j+1]
        ans.append(''.join(s))
        print(s)


ans.sort()
for i in ans:
    if i[0] == 'a':
        print(i)