N = int(input())
al = "abcdefghijklmnopqrstuvwxyz"
atoi = {s:i for i, s in enumerate(al)}
itoa = {i:s for i, s in enumerate(al)}

l = []
def func(s, i):
    if i == N:
        print(s)
        return
    # if al[:i] == s:
    #     for c in al[:i+1]:
    #         func(s + c, i+1)
    # else:
    #     for c in al:
    #         func(s + c, i+1 )

    # if i == N - 1:
    for c in al[:atoi[s[-1]]+2]:
        func(s+c, i+1)
    # else:
    #     for c in al[:i+1]:
    #         func(s+c, i+1) 

func("a", 1)