#include<bits/stdc++.h>
using namespace std;
int main(){
  long N,Y;cin>>N>>Y;
  for(long i=0;i<=N;i++){
    for(long j=0;i+j<=N;j++){
      long k=N-(i+j);
      if(10000*i+5000*j+1000*k==Y){
        cout<<i<<" "<<j<<" "<<k;
        return 0;
      }
    }
  }
  cout<<"-1 -1 -1";
}