import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    }

    static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    }

    static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) COtoshidama solver = new COtoshidama(); solver new COtoshidama() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    } COtoshidama public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        } solve {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int tot = in.nextInt(); tot in.nextInt() in.nextInt in int yukichi = -1; yukichi -1 1 int higuchi = -1; higuchi -1 1 int noguchi = -1; noguchi -1 1 for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            } {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            } for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                } int j = 0; int j = 0; j 0 j <= n - i j n - i n i j++ j++ j {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                } {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                } if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    } i * 10000 + j * 5000 + (n - i - j) * 1000 == tot i * 10000 + j * 5000 + (n - i - j) * 1000 i * 10000 + j * 5000 + (n - i - j) * 1000 i * 10000 i 10000 j * 5000 j 5000 (n - i - j) * 1000 (n - i - j) n - i - j n i j 1000 tot {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    } yukichi = i yukichi i higuchi = j higuchi j noguchi = n - i - j noguchi n - i - j n - i - j n i j break; out.println(yukichi + " " + higuchi + " " + noguchi) out.println out yukichi + " " + higuchi + " " + noguchi " " higuchi yukichi + " " + higuchi + " " + noguchi yukichi " " higuchi " " noguchi int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    }

    static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    }

    static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        COtoshidama solver = new COtoshidama();
        solver.solve(1, in, out);
        out.close();
    }

    static class COtoshidama {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int tot = in.nextInt();
            int yukichi = -1;
            int higuchi = -1;
            int noguchi = -1;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n - i; j++) {
                    if (i * 10000 + j * 5000 + (n - i - j) * 1000 == tot) {
                        yukichi = i;
                        higuchi = j;
                        noguchi = n - i - j;
                        break;
                    }
                }
            }
            out.println(yukichi + " " + higuchi + " " + noguchi);
        }

    }
}

