import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    }
} Main public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    } main {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int Y = scan.nextInt(); Y scan.nextInt() scan.nextInt scan int x = 0; x 0 int y = 0; y 0 int z = Y/1000; z Y/1000 Y 1000 for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        } int i=0; int i=0; i 0 i<N*10 i N*10 N 10 i++ i++ i {
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        } {
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        } if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            } x+y+z > N x+y+z x+y+z x y z N {
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            } if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                } y>=2 y 2 {
                    y = y - 2;
                    x++;
                } y = y - 2 y y - 2 y 2 x++ x if(z>=5) {
                    z = z - 5;
                    y++;
                } z>=5 z 5 {
                    z = z - 5;
                    y++;
                } z = z - 5 z z - 5 z 5 y++ y if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            } x+y+z < N x+y+z x+y+z x y z N {
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            } if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                } x>0 x 0 {
                    x--;
                    y = y + 2;
                } x-- x y = y + 2 y y + 2 y 2 if(y>4){
                    y--;
                    z = z + 5;
                } y>4 y 4 {
                    y--;
                    z = z + 5;
                } y-- y z = z + 5 z z + 5 z 5 {
                break;
            } break; if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        } x+y+z == N x+y+z x+y+z x y z N {
            System.out.println(x + " " + y + " " + z);
        } System.out.println(x + " " + y + " " + z) System.out.println System.out System System.out x + " " + y + " " + z " " y x + " " + y + " " + z x " " y " " z {
            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 String args[] args public class Main {
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    }
} public class Main {
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int Y = scan.nextInt();

        int x = 0; //10000円
        int y = 0; //5000円
        int z = Y/1000; //1000円

        for(int i=0; i<N*10; i++){
            if(x+y+z > N){
                if(y>=2){
                    y = y - 2;
                    x++;
                }else if(z>=5) {
                    z = z - 5;
                    y++;
                }
            }else if(x+y+z < N){
                if(x>0){
                    x--;
                    y = y + 2;
                }else if(y>4){
                    y--;
                    z = z + 5;
                }
            }else{
                break;
            }
        }
        if(x+y+z == N) {
            System.out.println(x + " " + y + " " + z);
        }else{
            System.out.println(-1 + " " + -1 + " " +  -1);
        }
    }
}
