import java.util.Scanner;

//  C - Otoshidama

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());
    Integer man = 0;
    Integer gosen = 0;
    Integer sen = 0;

    label: for(int i = 0; i <= N; i++) {
    	if(i * 10000 == Y && i == N) {
			man = i;
			break label;
    	}
    	for(int m = 0; m <= (N-i); m++) {
			if(i * 10000 + m * 5000 == Y && i + m == N) {
				man = i;
				gosen = m;
				break label;
			}

			for(int n = 0; n <= (N-i-m); n++) {
				if(i * 10000 + m * 5000 + n * 1000 == Y && i + m + n == N) {
					man = i;
					gosen = m;
					sen = n;
					break label;
				}
			}
    	}
    }
    if(man == 0 && gosen == 0 && sen ==0) {
    	System.out.println("-1 -1 -1");
    } else {
//		System.out.println(man*10000+gosen*5000+sen*1000);
//		System.out.println(man+gosen+sen);
		System.out.println(man.toString()+" "+gosen.toString()+" "+sen.toString());
    }


  }
}
/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