def solve(prime, pay)
  turi = pay - prime
  result = {100 => 0, 500 => 0, 1000 => 0}
  if turi >= 1000
    add = turi / 1000
    result[1000] += add
    turi -= add * 1000
  end
  if turi >= 500
    add = turi / 500
    result[500] += add
    turi -= add * 500
  end
  if turi >= 100
    add = turi / 100
    result[100] += add
    turi -= add * 100
  end
  result
end

def main
  STDIN.each_line{|line|
    prime, pay = line.split(" ").map{|n| n.to_i}
    if prime == 0 && pay == 0
      break
    end
    result = solve prime, pay
    puts "#{result[100]} #{result[500]} #{result[1000]}"
  }
end

main