import itertools

n=int(input())

A=[chr(ord('a') + i) for i in range(26)]

count = 0

for i in itertools.product(A, repeat=n):
    print(''.join(map(str,i)))
    count += 1
    if count == n:
        break