import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        } {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            } {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            } for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                } int j = 0; int j = 0; j 0 j <= n j n j++ j++ j {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                } {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                } if (i + j > n) {
                        continue;
                    } i + j > n i + j i j n {
                        continue;
                    } continue; int k = n - (i + j); k n - (i + j) n (i + j) i j int r = i * 10000 + j * 5000 + k * 1000; r i * 10000 + j * 5000 + k * 1000 i * 10000 + j * 5000 + k * 1000 i * 10000 i 10000 j * 5000 j 5000 k * 1000 k 1000 if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    } y == r y r {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    } System.out.println(i + " " + j + " " + k) System.out.println System.out System System.out i + " " + j + " " + k " " j i + " " + j + " " + k i " " j " " k return; int dead = -1; dead -1 1 System.out.println(dead + " " + dead + " " + dead) System.out.println System.out System System.out dead + " " + dead + " " + dead " " dead dead + " " + dead + " " + dead dead " " dead " " dead String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int y = sc.nextInt();

            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j > n) {
                        continue;
                    }
                    int k = n - (i + j);
                    int r = i * 10000 + j * 5000 + k * 1000;
                    if (y == r) {
                        System.out.println(i + " " + j + " " + k);
                        return;
                    }
                }
            }
            int dead = -1;
            System.out.println(dead + " " + dead + " " + dead);
        }
    }
}
