import java.io.*;
import java.util.*;
public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    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 s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int a = 10000 a 10000 b = 5000 b 5000 c = 1000; c 1000 for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        } int x = 0; int x = 0; x 0 x <= n x n x++ x++ x {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        } {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        } for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            } int y = 0; int y = 0; y 0 y <= n y n y++ y++ y {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            } {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            } int curSum = x * a + y * b + (n - x - y) * c; curSum x * a + y * b + (n - x - y) * c x * a + y * b + (n - x - y) * c x * a x a y * b y b (n - x - y) * c (n - x - y) n - x - y n x y c if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                } curSum == s && (n - x - y) >= 0 curSum == s curSum s (n - x - y) >= 0 (n - x - y) n - x - y n x y 0 {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                } System.out.println(x + " " + y + " " + (n - x - y)) System.out.println System.out System System.out x + " " + y + " " + (n - x - y) " " y x + " " + y + " " + (n - x - y) x " " y " " (n - x - y) n - x - y n x y return; System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" String args[] args public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        
        int a = 10000, b = 5000, c = 1000;

        for(int x = 0; x <= n; x++) {
            for(int y = 0; y <= n; y++) {
                int curSum = x * a + y * b + (n - x - y) * c;
                if(curSum == s && (n - x - y) >= 0) {
                    System.out.println(x + " " + y + " " + (n - x - y));
                    return;
                }

            }
        }

        System.out.println("-1 -1 -1");
    }
}