package main

import (
	"bufio"
	"fmt"
	"os"
)

var n int
var az string = "abcdefghijklmnopqrstuvwxyz"

var wr = bufio.NewWriter(os.Stdout)

func rec(s string, x int) {
	if x >= n {
		wr.WriteString(s + "\n")
		return
	}
	for i := 0; i <= x; i++ {
		rec(s+az[i:i+1], x+1)
	}
}

func main() {
	fmt.Scan(&n)

	rec("a", 1)
	wr.Flush()
}
