def f(num,N,S):
    alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o"]
    if N == num:
        for i in range(len(S)):
            print(S[i])
        return
    else:
        tmp = []
        length = len(S)
        for i in range(length):
            if i == 0:
                tmp.append(S[0]+"a")
                tmp.append(S[0]+"b")
            else:
                ttmp = S[i][-1]
                ind = alphabet.index(ttmp)
                for j in range(ind+2):
                    tmp.append(S[i]+alphabet[j])
        S = list(set(tmp))
        S.sort()
        f(num+1,N,S)

N = int(input())
f(1,N,["a"])