
def main():
	n  = int(input())
	ans = []
	queue=['a']
	while len(queue)>0:
		now = queue.pop(0)
		if len(now)==n:
			ans.append(now)
			continue
		mx=now[0]
		for i in range(0,len(now)):
			mx = max(mx, now[i])
		for i in range(ord('a'), ord(mx)+2):
			t=now+chr(i)
			queue.append(t)
	ans.sort()
	for i in ans:
		print(i)
if __name__=="__main__":
	main()