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

ans = []
st = set()
import itertools
for ptn in itertools.product('abc', repeat=N):
    h = 0
    for i in range(N-1):
        for j in range(i+1,N):
            h <<= 1
            if ptn[i]==ptn[j]:
                h += 1
    if h in st: continue
    st.add(h)
    ans.append(''.join(ptn))

print(*sorted(ans), sep='\n')