
def main():
	n  = int(input())
	ans = []
	queue=[]
	queue.append('a')
	while len(queue)>0:
		now = queue.pop(0)
		if len(now)==n:
			ans.append(now)
			continue
		lst = now[len(now)-1]
		diff = now + chr(ord(lst)-ord('a')+1+ord('a'))
		same = now+chr(ord(lst))
		queue.append(diff)
		queue.append(same)
	ans.sort()
	for i in ans:
		print(i)
if __name__=="__main__":
	main()