# Code for D - String Equivalence
# Use input() to fetch data from STDIN
n = int(input())
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

def d(x):
    return a[:x+1]

def s(level, count):
    if level == 1:
        return d(count)

    array = []
    for z in range(count+1):
        array.extend([a[z] + y for y in s(level - 1, z + 1)])
    return array

result = s(n, 0)
result.sort()
for x in result:
    print(x)

