import itertools
def solve():
    N = int(input())
    alphabets = ['a','b','c','d','e','f','g','h','i','j']
    comb = list(itertools.combinations_with_replacement(alphabets[:N],N))

    s = set() 
    for c in comb:
        if c[0] != 'a':
            break
        d = {}
        for char in c:
            if not char in d.keys():
                d[char] = alphabets[len(d.keys())]
        
        string = ""
        for char in c:
            string += d[char]
        s.add(string)

    ans = sorted(list(s))
    print(*ans, sep='\n')

if __name__ == '__main__':
    solve()