output_description: If the total value of N bills cannot be Y yen, print `-1 -1 -1`.
  
  If the total value of N bills can be Y yen, let one such set of bills be "x
  10000-yen bills, y 5000-yen bills and z 1000-yen bills", and print x, y, z
  with spaces in between. If there are multiple possibilities, any of them may
  be printed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N Y
attempt: # -*- coding: utf-8 -*-
  
  
  # 整数値入力 1文字の入力
  def input_one_number():
      return int(input())
  
  
  # 整数値龍力　複数の入力
  def input_multiple_number():
      return map(int, input().split())
  
  
  # 整数値龍力　複数の入力(配列)
  def input_multiple_number_as_list():
      return list(map(int, input().split()))
  
  
  # 整数値龍力　複数の入力(配列で1つずつ渡される)
  def input_multiple_number_as_list_sep(N):
      ins = []
      for i in range(N):
          ins.append(input())
      return ins
  
  
  # 2次元配列入力
  def input_map():
      return [list(map(int, list(input()))) for i in range(h)]
  
  
  # リスト出力
  def print_list(list):
      print(*list)
      return
  
  
  # 2次元配列出力
  def print_map(maplist):
      for i in maplist:
          print(*i, sep="")
      return
  
  
  # 素数生成
  def generate_primenums():
      n = 100
      primes = set(range(2, n + 1))
      for i in range(2, int(n**0.5 + 1)):
          primes.difference_update(range(i * 2, n + 1, i))
      primes = list(primes)
      return primes
  
  
  def memo():
      a = [0] * 5
      b = a  # 良くない配列のコピー
      b2 = a[:]  # 1次元のときはコピーはこれで良い
      a[1] = 3
      print("b:{}, b2:{}".format(b, b2))  # b:[0, 3, 0, 0, 0], b2:[0, 0, 0, 0, 0]
  
      import copy
  
      a = [[0] * 3 for i in range(5)]  # 2次元配列はこう準備、[[0]*3]*5だとだめ
      b = copy.deepcopy(a)  # 2次元配列はこうコピーする
  
      # 内包表記奇数のみ
      odd = [i for i in range(100) if i % 2 == 1]  # [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
  
      # 二部探索
      import bisect
  
      a = [1, 2, 3, 5, 6, 7, 8, 9]
      b = bisect.bisect_left(a, 8)
  
      # combinations、組み合わせ、順列
      from itertools import (
          permutations,
          combinations,
          combinations_with_replacement,
          product,
      )
  
      a = ["a", "b", "C"]
      print(list(permutations(a)))
      print(list(combinations(a, 2)))
      print(list(combinations_with_replacement(a, 3)))
  
  
  # 階乗
  def kaijo(n):
      import math
  
      return math.factorial(n)
  
  
  # 選び方（コンビネーション nCr）
  def num_combination(n, r):
      import math
  
      return math.factorial(n) // math.factorial(n - r)
  
  
  # 最大公約数、最小公倍数
  def calc_gcd(a, b):
      import fractions
  
      GCD = fractions.gcd(a, b)
      lcm = a * b // gcd
      return gcd, lcm
  
  
  # 複数の最大公約数
  def calc_gcd_list(l):
      gcd = l[0]
      for i in range(1, N):
          gcd = fractions.gcd(gcd, l[i])
      return gcd
  
  
  # 各桁の和
  def sum_digit(n):
      sum = 0
      while n > 0:
          sum += n % 10
          n //= 10
      return sum
  
  
  N, Y = input_multiple_number()
  
  p = Y - 1000 * N
  x, y, z = 0, 0, 0
  for i in range(2001):
      if (
          (p - i * 4000) % 9000 == 0
          and (p - i * 4000) >= 0
          and (p - i * 4000) / 9000 <= 2000
      ):
          y = i
          x = (p - i * 4000) // 9000
          z = N - x - y
          if 0 <= z and z <= 2000:
              break
  
  if z < 0 or 2000 < z:
      print("-1 -1 -1")
      print(x, y, z)
  else:
      print(x, y, z)
  
problem_description: Statement
  
  The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills.
  Below, the word "bill" refers to only these.
  
  According to Aohashi, he received an otoshidama (New Year money gift) envelope
  from his grandfather that contained N bills for a total of Y yen, but he may
  be lying. Determine whether such a situation is possible, and if it is, find a
  possible set of bills contained in the envelope. Assume that his grandfather
  is rich enough, and the envelope was large enough.
samples: [{"input": "9 45000", "output": "4 0 5\n    \n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9\nbills and 45000 yen in total. It is also possible that the envelope contained\n9 5000-yen bills, so the output `0 9 0` is also correct.\n\n* * *"}, {"input": "20 196000", "output": "-1 -1 -1\n    \n\nWhen the envelope contained 20 bills in total, the total value would be 200000\nyen if all the bills were 10000-yen bills, and would be at most 195000 yen\notherwise, so it would never be 196000 yen.\n\n* * *"}, {"input": "1000 1234000", "output": "14 27 959\n    \n\nThere are also many other possibilities.\n\n* * *"}, {"input": "2000 20000000", "output": "2000 0 0"}]