import strutils, sequtils
let get = iterator: string {.closure.} =
  for s in stdin.readAll.split: yield s
let read = proc: int = get().parseInt
template rep(a,b): seq = newSeqWith(b,a)
proc incEach(s: string, n: int): string =
  result = ""
  for c in s: result.add char(c.ord + n)
##############################################################

let n = read()
var s = newSeq[string]().rep 10

s[0] = @["a"]
s[1] = @["aa", "ab"]

for i in 2..<n:
  s[i] = s[i-1].mapIt('a' & it)
  var ab = "a"
  for j in 2..i:
    ab.add 'b'
    s[i].add s[i-j].mapIt(ab & it)
    s[i].add s[i-j].mapIt(ab & it.incEach 1)
    s[i].add s[i-j].mapIt(ab & it.incEach 2)

for s in s[n-1]:
  echo s  