n, k = gets.split.map(&:to_i)
max = k + 3 * n - 1
array = (k..max).to_a
answers = Array.new
n.times do
  option_1 = array.shift
  option_2 = array.pop
  index = array.bsearch_index { |i| i + option_1 <= option_2 }
  if !index
    puts -1
    exit
  end
  option_3 = array.delete_at(index)
  answers << [option_1, option_3, option_2]
end
answers.each do |answer|
  puts answer.join(" ")
end
