package main

import (
	"fmt"
)

const str = "abcdefghijklmn"

func main() {
	var N int
	fmt.Scanf("%d\n", &N)
	rec("", 0, N)

}

func rec(s string, pos int, max int) {
	if len(s) == max {
		fmt.Println(s)
		return
	}
	for i := 0; i < pos + 1; i ++ {
      	s := s + string([]rune(str)[i])
		rec(s, i+1, max)
	}
}