from collections import deque

ans= deque()
n=int(input())
ans.append("a"*n)

ds=["a","b","c"]

def str_plus(s):
    s1,s2,s3 = (s + x for x in ds)
    return s1,s2,s3

for i in range(1,n):
    s="a"*(n-i) + "b"

    deq = deque()
    deq.append(s)

    if i==1:
        ans.append(s)
    else:
        while len(deq) > 0:
            sa = deq.popleft()
            s1,s2,s3 = str_plus(sa)
            if len(s1) == n:
                ans.extend([s1,s2,s3])
            else:
                deq.extend([s1,s2,s3])

s_last=""
for i in range(n):
    s_last += chr(ord("a") + i)
ans.append(s_last)

for si in sorted(list(set(ans))):
    print(si)