import itertools
n = int(input())

lis = ["a","b","c","d","e",
		"f","g","h","i","j"]


#print(l)
if n>10:
	l = lis[:n]
	c = list(itertools.product(l, repeat=n-1))
	cand = []

	for i in range(len(c)):
		an = "a"
		for j in range(n-1):
			an += c[i][j]
		cand.append(an)
	#print(len(cand))
	#print(len(cand[0]))
else:
	l = lis[:n]
	cand = list(itertools.product(l, repeat=n))

#print(cand)

count = 0
for i in range(len(cand)):#何セットあるか
	temp = []
	temp.append(cand[i][0])
	cand[i] = list(cand[i])
	cand[i][0] = l[len(temp)-1]

	for j in range(1,n):#要素の数n
		for k in range(len(temp)):
			if cand[i][j] == temp[k]:#tempに入ってたら
				cand[i][j] = l[k]
			else:#未知なら
				temp.append(cand[i][j])
				cand[i][j] = l[len(temp)-1]


def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

				
ans = get_unique_list(cand)
for i in range(len(ans)):
	p = ""
	for j in range(n):
		p += ans[i][j]
	print(p)