n=int(input())

A=["aa","ab"]
num2alpha = lambda c: chr(c+64)
B=[]
num2alpha(3)
if n==1:
	print("a")
	exit()
if n==2:
	print("aa")
	print("ab")

for i in range(n-2):
	k=i+3
	for s in A:
		B.append(s+"a")
		B.append(s+"b")
		if s[-1]!= "a":
			B.append(s+chr(ord(s[-1])+1))
	A=A+B
	B=[]
for x in A:
	if len(x)==n:
		print(x)