n = map(int, raw_input().split(' '))[0]

def dfs(i, n, res, cur = []):
	if i==n:
		res.append(''.join(cur[::]))
		return

	vs = range(i+1)
	for v in vs: #range(last+1, n):
		dfs(i + 1, n , res, cur + [chr(v+ ord('a'))])

res =[]
dfs(0,n,res)
for w in res:print w