s_l= []
n=int(input())
print("a"*n)

def splus(s):
    s1 = s + "a"
    s2 = s + "b"
    s3 = s + "c"
    return s1, s2, s3

for i in range(1,n):
    s="a"*(n-i) + "b"
    s_l = [s]
    for j in range(i-1):
        for k in range(len(s_l)):
            sa = s_l.pop(k)
            s1,s2,s3 = splus(sa)
            s_l.append(s1)
            s_l.append(s2)
            s_l.append(s3)
    for sa in sorted(s_l):
        print(sa)            