import java.util.*;
public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} import java.util.*; util.* java public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    } main {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int yen = sc.nextInt(); yen sc.nextInt() sc.nextInt sc int s = yen/1000-n; s yen/1000-n yen/1000 yen 1000 n for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      } int i = 0; int i = 0; i 0 i<= Math.min(s/9,n) i Math.min(s/9,n) Math.min Math s/9 s 9 n i++ i++ i {
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      } {
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      } for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        } int j = 0; int j = 0; j 0 j<= Math.min(n-i,s/4) j Math.min(n-i,s/4) Math.min Math n-i n i s/4 s 4 j++ j++ j {
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        } {
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        } if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            } i*9+j*4==s i*9+j*4 i*9 i 9 j*4 j 4 s {
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            } System.out.println(i+" "+j+" "+(n-i-j)) System.out.println System.out System System.out i+" "+j+" "+(n-i-j) " " j i+" "+j+" "+(n-i-j) i " " j " " (n-i-j) n-i-j n i j return; System.out.println((-1)+" "+(-1)+" "+(-1)) System.out.println System.out System System.out (-1)+" "+(-1)+" "+(-1) " " (-1) (-1)+" "+(-1)+" "+(-1) (-1) 1 " " (-1) 1 " " (-1) 1 String[] args args public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    } lcm {
      return x*y/gcd(x,y);
    } return x*y/gcd(x,y); x*y/gcd(x,y) x*y x y gcd(x,y) gcd x y int x x int y y public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    } gcd {
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    } if(x < y)return gcd(y,x); x < y x y return gcd(y,x); gcd(y,x) gcd y x if(y==0)return x; y==0 y 0 return x; x return gcd(y,x%y); gcd(y,x%y) gcd y x%y x y int x x int y y public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
} Main
import java.util.*;
public class Main{   
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int yen = sc.nextInt();
      int s = yen/1000-n;
      for(int i = 0;i<= Math.min(s/9,n);i++){
      	for(int j = 0;j<= Math.min(n-i,s/4);j++){
        	if(i*9+j*4==s){
            	System.out.println(i+" "+j+" "+(n-i-j));
                return;
            }
        }
      }
      System.out.println((-1)+" "+(-1)+" "+(-1));
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
}