package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, 1000000009)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(Scanner())
	l := []string{"b", "c", "d", "e", "f", "g", "h", "i", "j"}
	for i := n; i > 0; i-- {
		seed := make([]string, i)
		for j := 0; j < i; j++ {
			seed[j] = "a"
		}
		a(0, n, seed, l)
	}
}
func a(mx int, n int, seed []string, l []string) {
	if len(seed) == n {
		fmt.Println(strings.Join(seed, ""))
	} else {
		for i := 0; i < mx; i++ {
			a(i+1, n, append(seed, l[i]), l)
		}
		a(mx+1, n, append(seed, l[mx]), l)
	}
}
func smaller(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}
