num = int(input())
word = "a" * num
while (True):
	print(word)
	if word == (("b" * (num - 1)) + "a"):
		print(word)
		break
	else:
		word = list(word)
		for i in [num:0:-1]:
			if word[i] == "a":
				word[i] == "b"
				for j in range(i + 1, num):
					word[j] == "a"
				word = "".join(word)
				break