alpha=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
le=int(input())
if le==1:
    print("a")
elif le==2:
    print("aa")
    print("ab")
else:
    al=["aa","ab"]
    for i in range(le-2):
        al=["a"+i for i in al]
        for i1 in range(len(al)):
            val=al[i1][0]+"b"+al[i1][2:]
            al.append(val)
        al.append("".join(alpha[:i+3]))
        al=sorted(list(set(al)))
    for i in al:
        print(i)