std=[]
n=int(input())
cmb=[[] for i in range(n)]
cmb[0].append("a")
tmp=[[] for i in range(n)]
if n==1:
	print("a")
for i in range(1,n):
	for j in range(len(cmb)):
		for s in cmb[j]:
			for k in range(0,j+1):
				tmp[j].append(s+chr(ord("a")+k))
			tmp[j+1].append(s+chr(ord("a")+k+1))
	cmb=tmp
	tmp=[[] for i in range(n)]
lst=[]
for i in range(len(cmb)):
	for std in cmb[i]:
		lst.append(std)
lst.sort()
for i in range(len(lst)):
	print(lst[i])