from collections import deque
import sys
N = int(input())

if N == 1:
	print('a')
	sys.exit()
else:
	ans = []
	def solve(s):
		if len(s) == N:
			ans.append(s)
			return 
		cp = s[-1]
		o = ord(cp)
		for n in range(97, o+2):
			solve(s + chr(n))
	solve('a')
	for a in ans:
		print(a)
	