#include <iostream>
using namespace std;

int main(){
  int n,y; cin>>n>>y;
  int a,b,c;
  
  c=(y%5000)/1000; y=y-y%5000;
  b=(y%10000)/5000; y=y-y%10000;
  a=y/10000;
  
  if(a+b+c>n){cout<<"-1 -1 -1";}
  else{
    int x=n-a-b-c;
    printf("%d %d %d",a-x,b+2*x,c);
  }
  return 0;
}