import sequtils, strutils, algorithm, math, future, sets, tables, hashes, intsets
let read = iterator : string {.closure.} = (while true : (for s in stdin.readLine.split : yield s))

var rec : proc(cur : string, cnt : int)

proc solve() =
   
   var
      n = read().parseInt

   rec = proc(cur : string, cnt : int) = 
      if cur.len == n : 
         echo cur
      else : 
         for ch in 0 .. cnt : 
            rec(cur & char(int('a') + ch), ch + 1)
   rec("a", 1)

solve()
