package main

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

// input scanner
var sc = bufio.NewScanner(os.Stdin)

const (
	initialBufSize = 10e4
	maxBufSize     = 10e6
)

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

// util
func max(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n > ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func min(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n < ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func run(n int, now int) []int {
	s := strconv.Itoa(n)
	var prev int
	for i := 0; i < len(s)-now; i++ {
		p, _ := strconv.Atoi(s[i : i+1])
		fmt.Println(p)
		if p > prev {
			prev = p
		}
	}
	if now == 1 {
		var ans []int
		for i := 0; i < prev+1; i++ {
			ans = append(ans, n+i)
		}
		return ans
	}
	var ans []int
	for i := 0; i < prev+1; i++ {
		ans = append(ans, run(n+i*int(math.Pow(10, float64(now-1))), now-1)...)
	}
	return ans
}

// main
func main() {
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)
	n := nextInt()
	var a int
	for i := 0; i < n; i++ {
		a += int(math.Pow(10.0, float64(i)))
	}
	if n == 1 {
		fmt.Println("a")
		return
	}
	ans := run(a, n-1)
	for _, num := range ans {
		s := strconv.Itoa(num)
		for i := 0; i < len(s); i++ {
			m, _ := strconv.Atoi(s[i : i+1])
			fmt.Printf(string('a' + m - 1))
		}
		fmt.Printf("\n")
	}
}
