package main

import "fmt"

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

	standards := make(map[int][]string, 0)
	standards[1] = append(standards[1], "a")
	for i := 1; i <= n; i++ {
		for _, standard := range standards[i-1] {
			standards[i] = append(standards[i], standard+"a")
			standards[i] = append(standards[i], standard+"b")
		}
	}
	for _, v := range standards[n] {
		fmt.Println(v)
	}
}
