import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    }

} import java.io.PrintWriter; PrintWriter java.io import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    }

} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    } run {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc int c10000 = 2000; c10000 2000 int c5000 = 2000; c5000 2000 int c1000 = 0; c1000 0 c1000 = n-c10000-c5000 c1000 n-c10000-c5000 n-c10000-c5000 n c10000 c5000 if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        } c1000>=0 c1000 0 {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } out.print(c10000+" ") out.print out c10000+" " c10000 " " out.print(c5000+" ") out.print out c5000+" " c5000 " " out.print(c1000+" ") out.print out c1000+" " c1000 " " out.flush() out.flush out {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        } out.print(-1+" ") out.print out -1+" " -1 1 " " out.print(-1+" ") out.print out -1+" " -1 1 " " out.print(-1+" ") out.print out -1+" " -1 1 " " out.flush() out.flush out public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    }

} public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    }

} Main
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int y = sc.nextInt();

        int c10000 = 2000;
        int c5000 = 2000;
        int c1000 = 0;

        label:
        for (int i=0; i<=n; i++) {
            for (int j=0; j<=n; j++) {
                if ((9000*i+4000*j)==(y-1000*n)) {
                    c10000 = i;
                    c5000 = j;
                    if (c10000+c5000<=n) break label;
                }
            }
        }

        c1000 = n-c10000-c5000;

//        out.print(c10000+" ");
//        out.print(c5000+" ");
//        out.print(c1000+" ");

        if (c1000>=0) {
            out.print(c10000+" ");
            out.print(c5000+" ");
            out.print(c1000+" ");
            out.flush();
        } else {
            out.print(-1+" ");
            out.print(-1+" ");
            out.print(-1+" ");
            out.flush();
        }



    }

}
