n = int(input())
A = ['a' for _ in range(n)]
ans = []
for i in range(2**(n-1)):
	A = ['a' for _ in range(n)]
	for j in range(n-1):
			if i & (1<<j):
				A[j+1] = 'b'

	ans.append(A)

ans.sort()
for i in ans:
	for j in i:
		print(j,end="")
	print()
