numal=lambda c:chr(c+97)
n=int(input())
alp="abcdefghij"
unchi=[[],[],[],[],[],[],[],[],[],[]]
unchi[0].append("0")
k=1
if n>=2:
	while k<n:
		for i in range(len(unchi[k-1])):
			unchi[k].append(unchi[k-1][i]+str(int(unchi[k-1][i][k-1])))
			unchi[k].append(unchi[k-1][i]+str(int(unchi[k-1][i][k-1])+1))
		k+=1
for i in range(len(unchi[n-1])):
	s = []
	for k in range(n):
		s.append(numal(int(unchi[n-1][i][k])))
	print("".join(s))