package main

import (
	"fmt"
)

func dfs(n int, s []byte) {
	if n == len(s) {
		fmt.Println(string(s))
		return
	}
	c := s[n-1]
	for i := byte(0); i <= c-'a'+1; i++ {
		s[n] = i + 'a'
		dfs(n+1, s)
	}
}

func main() {
	var n int
	fmt.Scan(&n)
	s := make([]byte, n)
	s[0] = 'a'
	dfs(1, s)
}
