N = int(input())

a = 0
ans = ['a'] * 2**(N - 1)

for n in range(1, N):
    for i in range(2**(N - 1)):
        if i % 2 == 0:
            c = chr(ord(ans[i][-1]) + 1)
            ans[i] += str(c)
        else:
            c = chr(ord(ans[i][-1]))
            ans[i] += str(c)

    ans = sorted(ans)

for a in ans:
    print(a)
