n = int(input())
a = [0]*n

def print_str():
    for i in reversed(a):
        print(chr(97+i), end='')
    print()

print_str()
while True:
    for i in range(n-1):
        if a[i] <= a[i+1]:
            a[i] += 1
            for j in range(i):
                a[j] = 0
            print_str()
            break
    else:
        break
