#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,y;
  cin>>n>>y;
  y/=1000;
  int p=-1;
  int q=-1;
  int r=-1;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n-i;j++){
      if(10*i+5*j+n-i-j==y){
        p=i;
        q=j;
        r=n-i-j;
      }
    }
  }
  cout<<p<<" "<<q<<" "<<r<<endl;
}