import java.util.*;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Y = sc.nextLong();
        sc.close();

        long num_10000 = -1;
        long num_5000 = -1;
        long num_1000 = -1;

        long target = Y - 1000 * N;
        long tmp = -1;

        for (int i = 0; i <= N; i++) {
            if ((target - 9000 * i) % 4000 == 0) {
                tmp = (target - 9000 * i) / 4000;
                if ((tmp >= 0) && (N - tmp - i) >= 0) {
                    num_10000 = i;
                    num_5000 = tmp;
                    num_1000 = N - num_10000 - num_5000;
                    break;
                }
            }
        }

        System.out.println(num_10000 + " " + num_5000 + " " + num_1000);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz