from functools import reduce
from itertools import product
n = int(input())

alphabet = "abcdefghij"
ans = ["a"]

for i in range(1, n):
	ans = [a + b for a, b in product(ans, alphabet[:(i + 1)])]

print(*ans, sep = "\n")