
import java.util.*;

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

        long n = sc.nextLong();
        long m = sc.nextLong();


        for (long x = 0; x <= n; ++x) {
            long tmpx = x * 10000L;
            if (tmpx > m) {
                break;
            }
            for (long y = 0; y <= n - x; ++y) {
                long tmpy = tmpx + y * 5000L;
                if (tmpy > m) {
                    break;
                }
                for (long z = 0; z <= n - x - y; ++z) {
                    long tmpz = tmpy + z * 1000L;
                    if (tmpz > m) {
                        break;
                    }
                    if (tmpz == m && x + y + z == n) {
                        System.out.println(String.format("%d %d %d", x, y, z));
                        return;
                    }
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
}

/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