import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int y = sc.nextInt();
		int x = y / 1000 - n;
		int coefficient1 = 9;	//10000円の係数
		int coefficient2 = 4; //5000円の係数
		int result[] = {-1, -1, -1};
		
		for (int i = 0; i <= n; i++) {
			int tmp = x - (9 * i);
			int tmp2[] = new int[3];
			if (tmp % 4 ==0 && tmp >= 0 && tmp <= 4 * n) {
				tmp2[0] = i;
				tmp2[1] = tmp / 4;
				tmp2[2] = n - tmp2[0] - tmp2[1];
				if (tmp2[2] >= 0 && tmp2[2] <= n) {
					result = tmp2;
					break;
				}
			}
		}
		
		System.out.println(result[0] + " " + result[1] + " " + result[2]);
	}
}

/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