import java.util.*;

public class Main {

	public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	}

} Main public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	} main {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	} int total; total int sen = -1 sen -1 1 gosen = -1 gosen -1 1 man = -1; man -1 1 boolean judge = false; judge false Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		} {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		} for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			} int j = 0; int j = 0; j 0 i+j <= N i+j i j N j++ j++ j {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			} {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			} total = i*1000 + j*5000 + (N-i-j)*10000 total i*1000 + j*5000 + (N-i-j)*10000 i*1000 + j*5000 + (N-i-j)*10000 i*1000 i 1000 j*5000 j 5000 (N-i-j)*10000 (N-i-j) N-i-j N i j 10000 if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				} total == Y total Y {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				} judge = true judge true sen = i sen i gosen = j gosen j man = N-i-j man N-i-j N-i-j N i j if(judge) break; judge break; if(judge) break; judge break; System.out.println(man + " " + gosen + " " + sen) System.out.println System.out System System.out man + " " + gosen + " " + sen " " gosen man + " " + gosen + " " + sen man " " gosen " " sen sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		int total;
		int sen = -1, gosen = -1, man = -1;
		boolean judge = false;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();

		for(int i = 0; i <= N; i++) {
			for(int j = 0; i+j <= N; j++) {
				total = i*1000 + j*5000 + (N-i-j)*10000;
				if(total == Y) {
					judge = true;
					sen = i;
					gosen = j;
					man = N-i-j;
				}
			if(judge) break;
			}
		if(judge) break;
		}
	System.out.println(man + " " + gosen + " " + sen);
	sc.close();
	}

}