N = gets.to_i
$str_memo = %w(a b c d e f g h i j k)
def rec(array)
  size = array.size
  if size == N
    puts array.join("")
    return
  end
  (size + 1).times do |i|
    break if !array.empty? && array.last.ord < i + 96
    rec(array + [$str_memo[i]])
  end
end
rec([])
