N = int(input())
if N==1:
    print('a')
    exit()

ans = []
for i in range(1<<(N-1)):
    s = 'a'
    for j in range(N-1):
        if i&(1<<j):
            s += s[-1]
        else:
            s += ('a' if s[-1]=='b' else 'b')
    ans.append(s)
print(*sorted(ans), sep='\n')