def main():
	n  = int(input())
	ans = []
	queue=[]
	queue.append('a')
	while len(queue)>0:
		now = queue.pop(0)
		if now in ans:
			continue
		if len(now)==n:
			ans.append(now)
			continue
		for i in range(0,len(now)):
			lst = now[i]
			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()