import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong(), y = s.nextLong();
        long mx = -1;
        long a10000 = -1, a5000 = -1, a1000 = -1;
        boolean ok = true;
        for(long i = 0; i <= y / 10000 && ok; ++i) {
            for(long j = 0; j <= (y - i * 10000)/ 5000; ++j) {
                long total = i * 10000 + j * 5000;
                long k = (y - total) / 1000;
                if (i * 10000 + j * 5000 + k * 1000 == y && i + j + k == n) {
                    a10000 = i;
                    a5000 = j;
                    a1000 = k;
                    ok = false;
                    break;
                }
            }
        }
        System.out.println(a10000 + " " + a5000 + " " + a1000);
    }
}

/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