import itertools

def resolve():
    n = int(input())
    l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

    init = ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
    print(''.join(init[0:n]))
    for str in itertools.combinations_with_replacement(l[0:n], n):
        if len(list(set(str))) != 1:
            print(''.join(str))
            
resolve()