import java.io.*;

public class Main {
    static int N;
    static int Y;
    public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    }

    static final FastScanner sc = new FastScanner(System.in);
    static PrintWriter writer = new PrintWriter(System.out);

    static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    }
    //FAST SCANNER END HERE
} import java.io.*; io.* java public class Main {
    static int N;
    static int Y;
    public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    }

    static final FastScanner sc = new FastScanner(System.in);
    static PrintWriter writer = new PrintWriter(System.out);

    static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    }
    //FAST SCANNER END HERE
} Main static int N; N static int Y; Y static final FastScanner sc = new FastScanner(System.in); sc new FastScanner(System.in) static PrintWriter writer = new PrintWriter(System.out); writer new PrintWriter(System.out) public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    } main {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    } N = sc.nextInt() N sc.nextInt() sc.nextInt sc Y = sc.nextInt() Y sc.nextInt() sc.nextInt sc int y = Y/1000; y Y/1000 Y 1000 boolean solved = false; solved false for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        } int a = 0; int a = 0; a 0 a <= N a N a++ a++ a {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        } {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        } if (solved) break; solved break; for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            } int b = 0; int b = 0; b 0 b <= N b N b++ b++ b {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            } {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            } if (solved) break; solved break; int h = 9 * a + 4 * b; h 9 * a + 4 * b 9 * a 9 a 4 * b 4 b if (h != y - N) continue; h != y - N h y - N y N continue; if (a+b > N) continue; a+b > N a+b a b N continue; solved = true solved true writer.print(a) writer.print writer a writer.print(" ") writer.print writer " " writer.print(b) writer.print writer b writer.print(" ") writer.print writer " " writer.println(N - a - b) writer.println writer N - a - b N - a - b N a b if (!solved) {
            writer.println("-1 -1 -1");
        } !solved solved {
            writer.println("-1 -1 -1");
        } writer.println("-1 -1 -1") writer.println writer "-1 -1 -1" writer.flush() writer.flush writer String[] args args static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    } FastScanner Reader input; input FastScanner() {
            this(System.in);
        } FastScanner {
            this(System.in);
        } this(System.in) this System.in System System.in FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        } FastScanner {
            this.input = new BufferedReader(new InputStreamReader(stream));
        } this.input = new BufferedReader(new InputStreamReader(stream)) this.input this this.input new BufferedReader(new InputStreamReader(stream)) InputStream stream stream int nextInt() {
            return (int) nextLong();
        } nextInt {
            return (int) nextLong();
        } return (int) nextLong(); (int) nextLong() nextLong long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        } nextLong {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        } try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            } IOException e {
                e.printStackTrace();
                return -1;
            } e.printStackTrace() e.printStackTrace e return -1; -1 1 {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } int sign = 1; sign 1 int b = input.read(); b input.read() input.read input while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                } (b < '0' || '9' < b) && b != '-' && b != '+' (b < '0' || '9' < b) && b != '-' && b != '+' (b < '0' || '9' < b) b < '0' b '0' '9' < b '9' b b != '-' b '-' b != '+' b '+' {
                    b = input.read();
                } b = input.read() b input.read() input.read input if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                } b == '-' b '-' {
                    sign = -1;
                    b = input.read();
                } sign = -1 sign -1 1 b = input.read() b input.read() input.read input if (b == '+') {
                    b = input.read();
                } b == '+' b '+' {
                    b = input.read();
                } b = input.read() b input.read() input.read input long ret = b - '0'; ret b - '0' b '0' while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                } true {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                } b = input.read() b input.read() input.read input if (b < '0' || '9' < b) return ret * sign; b < '0' || '9' < b b < '0' b '0' '9' < b '9' b return ret * sign; ret * sign ret sign ret *= 10 ret 10 ret += b - '0' ret b - '0' b '0' double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        } nextDouble {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        } try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            } IOException e {
                e.printStackTrace();
                return Double.NaN;
            } e.printStackTrace() e.printStackTrace e return Double.NaN; Double.NaN Double Double.NaN {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } double sign = 1; sign 1 int b = input.read(); b input.read() input.read input while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                } (b < '0' || '9' < b) && b != '-' && b != '+' (b < '0' || '9' < b) && b != '-' && b != '+' (b < '0' || '9' < b) b < '0' b '0' '9' < b '9' b b != '-' b '-' b != '+' b '+' {
                    b = input.read();
                } b = input.read() b input.read() input.read input if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                } b == '-' b '-' {
                    sign = -1;
                    b = input.read();
                } sign = -1 sign -1 1 b = input.read() b input.read() input.read input if (b == '+') {
                    b = input.read();
                } b == '+' b '+' {
                    b = input.read();
                } b = input.read() b input.read() input.read input double ret = b - '0'; ret b - '0' b '0' while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                } true {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                } b = input.read() b input.read() input.read input if (b < '0' || '9' < b) break; b < '0' || '9' < b b < '0' b '0' '9' < b '9' b break; ret *= 10 ret 10 ret += b - '0' ret b - '0' b '0' if (b != '.') return sign * ret; b != '.' b '.' return sign * ret; sign * ret sign ret double div = 1; div 1 b = input.read() b input.read() input.read input while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                } ret *= 10 ret 10 ret += b - '0' ret b - '0' b '0' div *= 10 div 10 b = input.read() b input.read() input.read input return sign * ret / div; sign * ret / div sign * ret sign ret div char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        } nextChar {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        } try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            } IOException e {
                e.printStackTrace();
                return 0;
            } e.printStackTrace() e.printStackTrace e return 0; 0 {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } int b = input.read(); b input.read() input.read input while (Character.isWhitespace(b)) {
                    b = input.read();
                } Character.isWhitespace(b) Character.isWhitespace Character b {
                    b = input.read();
                } b = input.read() b input.read() input.read input return (char) b; (char) b String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        } nextStr {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        } try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            } IOException e {
                e.printStackTrace();
                return "";
            } e.printStackTrace() e.printStackTrace e return ""; "" {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = input.read(); b input.read() input.read input while (Character.isWhitespace(b)) {
                    b = input.read();
                } Character.isWhitespace(b) Character.isWhitespace Character b {
                    b = input.read();
                } b = input.read() b input.read() input.read input while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                } b != -1 && !Character.isWhitespace(b) b != -1 b -1 1 !Character.isWhitespace(b) Character.isWhitespace(b) Character.isWhitespace Character b {
                    sb.append((char) b);
                    b = input.read();
                } sb.append((char) b) sb.append sb (char) b b = input.read() b input.read() input.read input return sb.toString(); sb.toString() sb.toString sb public class Main {
    static int N;
    static int Y;
    public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    }

    static final FastScanner sc = new FastScanner(System.in);
    static PrintWriter writer = new PrintWriter(System.out);

    static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    }
    //FAST SCANNER END HERE
} public class Main {
    static int N;
    static int Y;
    public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    }

    static final FastScanner sc = new FastScanner(System.in);
    static PrintWriter writer = new PrintWriter(System.out);

    static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    }
    //FAST SCANNER END HERE
} Main
import java.io.*;

public class Main {
    static int N;
    static int Y;
    public static void main(String[] args) {
        N = sc.nextInt();
        Y = sc.nextInt();
        int y = Y/1000;
        boolean solved = false;
        for (int a = 0; a <= N; a++) {
            if (solved) break;
            for (int b = 0; b <= N; b++) {
                if (solved) break;
                int h = 9 * a + 4 * b;
                if (h != y - N) continue;
                if (a+b > N) continue;
                solved = true;
                writer.print(a);
                writer.print(" ");
                writer.print(b);
                writer.print(" ");
                writer.println(N - a - b);
            }
        }
        if (!solved) {
            writer.println("-1 -1 -1");
        }
        writer.flush();
    }

    static final FastScanner sc = new FastScanner(System.in);
    static PrintWriter writer = new PrintWriter(System.out);

    static class FastScanner {
        Reader input;
 
        FastScanner() {
            this(System.in);
        }
 
        FastScanner(InputStream stream) {
            this.input = new BufferedReader(new InputStreamReader(stream));
        }
 
        int nextInt() {
            return (int) nextLong();
        }
 
        long nextLong() {
            try {
                int sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                long ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) return ret * sign;
                    ret *= 10;
                    ret += b - '0';
                }
            } catch (IOException e) {
                e.printStackTrace();
                return -1;
            }
        }
 
        double nextDouble() {
            try {
                double sign = 1;
                int b = input.read();
                while ((b < '0' || '9' < b) && b != '-' && b != '+') {
                    b = input.read();
                }
                if (b == '-') {
                    sign = -1;
                    b = input.read();
                } else if (b == '+') {
                    b = input.read();
                }
                double ret = b - '0';
                while (true) {
                    b = input.read();
                    if (b < '0' || '9' < b) break;
                    ret *= 10;
                    ret += b - '0';
                }
                if (b != '.') return sign * ret;
                double div = 1;
                b = input.read();
                while ('0' <= b && b <= '9') {
                    ret *= 10;
                    ret += b - '0';
                    div *= 10;
                    b = input.read();
                }
                return sign * ret / div;
            } catch (IOException e) {
                e.printStackTrace();
                return Double.NaN;
            }
        }
 
        char nextChar() {
            try {
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                return (char) b;
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
        }
 
        String nextStr() {
            try {
                StringBuilder sb = new StringBuilder();
                int b = input.read();
                while (Character.isWhitespace(b)) {
                    b = input.read();
                }
                while (b != -1 && !Character.isWhitespace(b)) {
                    sb.append((char) b);
                    b = input.read();
                }
                return sb.toString();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }
    }
    //FAST SCANNER END HERE
}
