n = int(input())

az = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new_l = l + az[i]
      		out_list.append(new_l)
	return out_list

line = ["a"]

for _ in range(n-1):
	line = norm(1,line)
  
for l in line:
	print(l)
