package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"math/rand"
	"os"
	"strconv"
	"time"
)

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

var N int
var hashteble [10]int
var check map[int]bool

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
	rand.Seed(time.Now().UnixNano())
	check = map[int]bool{}
	for i := 0; i < 10; i++ {
		hashteble[i] = int(rand.Int31())
	}
	// log.Println(hashteble)
	N = nextInt()
	a := make([]int, 0)
	a = append(a, 0)
	generate(1, a)
}

func generate(now int, a []int) {
	if now == N {
		output(a)
	} else {
		for i := 0; i < N; i++ {
			b := make([]int, len(a))
			copy(b, a)
			b = append(b, i)
			generate(now+1, b)
		}
	}
}

var alpha string = "abcdefghijkl"

func output(a []int) {
	used := make([]int, len(a))
	var now int
	for i := 0; i < N; i++ {
		used[i] = -1
	}
	ans := make([]int, len(a))
	for i := 0; i < len(a); i++ {
		if used[a[i]] == -1 {
			used[a[i]] = now
			now++
		}
		ans[i] = used[a[i]]
	}
	// log.Println(check)
	if original(ans) {
		for i := 0; i < N; i++ {
			fmt.Print(string(alpha[ans[i]]))
		}
		fmt.Println("")
	}
}

func original(ans []int) bool {
	var hash int
	for i := 0; i < len(ans); i++ {
		hash += hashteble[i] ^ hashteble[ans[i]]
	}
	// log.Println(ans, check[hash], hash)
	if check[hash] == false {
		check[hash] = true
		return true
	} else {
		return false
	}
}

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

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}
