import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    }
} 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 y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          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 y = sc.nextInt() / 1000; y sc.nextInt() / 1000 sc.nextInt() sc.nextInt sc 1000 int one = 0 one 0 five = 0 five 0 ten = n; ten n int check; check try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        } catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        } Exception e {
          System.out.println(-1 + " " + -1 + " " + -1);
        } 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 {
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        } while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        } one * 1 + five * 5 + ten * 10 != y one * 1 + five * 5 + ten * 10 one * 1 + five * 5 + ten * 10 one * 1 one 1 five * 5 five 5 ten * 10 ten 10 y {
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        } if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          } one * 1 + five * 5 + ten * 10 > y one * 1 + five * 5 + ten * 10 one * 1 + five * 5 + ten * 10 one * 1 one 1 five * 5 five 5 ten * 10 ten 10 y {
            ten--;
            one++;
          } ten-- ten one++ one if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          } one * 1 + five * 5 + ten * 10 < y one * 1 + five * 5 + ten * 10 one * 1 + five * 5 + ten * 10 one * 1 one 1 five * 5 five 5 ten * 10 ten 10 y {
            one--;
            five++;
          } one-- one five++ five if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          } one < 0 || five < 0 || ten < 0 one < 0 || five < 0 || ten < 0 one < 0 one 0 five < 0 five 0 ten < 0 ten 0 {
            throw new Exception();
          } throw new Exception(); new Exception() System.out.println(ten + " " + five + " " + one) System.out.println System.out System System.out ten + " " + five + " " + one " " five ten + " " + five + " " + one ten " " five " " one String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
        int n = sc.nextInt();
        int y = sc.nextInt() / 1000;
        int one = 0,five = 0,ten = n;
        int check;
        try{
        while(one * 1 + five * 5 + ten * 10 != y){
          if(one * 1 + five * 5 + ten * 10 > y){
            ten--;
            one++;
          }else if(one * 1 + five * 5 + ten * 10 < y){
            one--;
            five++;
          }
          if(one < 0 || five < 0 || ten < 0){
            throw new Exception();
          }
        }    
          System.out.println(ten + " " + five + " " + one);
        }catch(Exception e){
          System.out.println(-1 + " " + -1 + " " + -1);
        }
    }
}