n = int(input())

chars = [
    'a',
    'b',
    'c',
    'd',
    'e',
    'f',
    'g',
    'h',
    'i',
    'j']

def f(i):
    if i == 1:
        return [chars[i - 1]]
    else:
        temp = f(i - 1)
        e = []
        for j in temp:
            for k in range(i - 1):
                e.append(j + chars[k])
        e.append(''.join(chars[0:i]))
        return e
    
result = f(n)
for i in result:
    print(i)
    
