
import java.util.Scanner;

public class Main {
    private static final int YUKICHI = (int) 1e4;
    private static final int HIGUCHI = (int) (5 * 1e3);
    private static final int NOGUCHI = (int) 1e3;

    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static final int YUKICHI = (int) 1e4;
    private static final int HIGUCHI = (int) (5 * 1e3);
    private static final int NOGUCHI = (int) 1e3;

    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
} Main private static final int YUKICHI = (int) 1e4; YUKICHI (int) 1e4 private static final int HIGUCHI = (int) (5 * 1e3); HIGUCHI (int) (5 * 1e3) 5 1e3 private static final int NOGUCHI = (int) 1e3; NOGUCHI (int) 1e3 public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    } main {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner final int y = scanner.nextInt(); y scanner.nextInt() scanner.nextInt scanner for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        } {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        } for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            } int j = 0; int j = 0; j 0 j <= n - i j n - i n i j++ j++ j {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            } {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            } if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                } YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) YUKICHI * i YUKICHI i HIGUCHI * j HIGUCHI j NOGUCHI * (n - i - j) NOGUCHI (n - i - j) n - i - j n i j y {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                } System.out.println(i + " " + j + " " + (n - i - j)) System.out.println System.out System System.out i + " " + j + " " + (n - i - j) " " j i + " " + j + " " + (n - i - j) i " " j " " (n - i - j) n - i - j n i j return; System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" final String[] args args public class Main {
    private static final int YUKICHI = (int) 1e4;
    private static final int HIGUCHI = (int) (5 * 1e3);
    private static final int NOGUCHI = (int) 1e3;

    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
} public class Main {
    private static final int YUKICHI = (int) 1e4;
    private static final int HIGUCHI = (int) (5 * 1e3);
    private static final int NOGUCHI = (int) 1e3;

    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
} Main

import java.util.Scanner;

public class Main {
    private static final int YUKICHI = (int) 1e4;
    private static final int HIGUCHI = (int) (5 * 1e3);
    private static final int NOGUCHI = (int) 1e3;

    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();
        final int y = scanner.nextInt();

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n - i; j++) {
                if (YUKICHI * i + HIGUCHI * j + NOGUCHI * (n - i - j) == y) {
                    System.out.println(i + " " + j + " " + (n - i - j));
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
}
