import collections
N = int(input())
output = []
for i in range(2 ** N):
    ans = ""
    ones = []
    zeros = []
    for j in range(N):
        if i >> j & 1 == 1:
            ones.append(N - 1 - j)
        else:
            zeros.append(N - 1 - j)
    charset = collections.deque([chr(ord("a") + i) for i in range(26)])
    used_index = 1
    for k in range(N):
        if len(ones) > 1:
            if k in ones:
                ans += "a"
            else:
                ans += charset[used_index]
                used_index += 1
        else:
            ans += charset.popleft()
    output.append(ans)
    
[print(ans) for ans in sorted(list(set(output)))]          