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 man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	} 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 int man_bill = -1; man_bill -1 1 int gosen_bill = -1; gosen_bill -1 1 int sen_bill = -1; sen_bill -1 1 final int man = 10000; man 10000 final int gosen = 5000; gosen 5000 final int sen = 1000; sen 1000 for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		} int i=0; int i=0; i 0 i<=n i n i++ i++ i {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		} {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		} for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			} int j=0; int j=0; j 0 j+i<=n j+i j i n j++ j++ j {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			} {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			} int c= n-j-i; c n-j-i n-j-i n j i int tot = i*man + j*gosen + c*sen; tot i*man + j*gosen + c*sen i*man + j*gosen + c*sen i*man i man j*gosen j gosen c*sen c sen if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				} y == tot y tot {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				} man_bill = i man_bill i gosen_bill = j gosen_bill j sen_bill = c sen_bill c System.out.println(man_bill + " " + gosen_bill + " " + sen_bill) System.out.println System.out System System.out man_bill + " " + gosen_bill + " " + sen_bill " " gosen_bill man_bill + " " + gosen_bill + " " + sen_bill man_bill " " gosen_bill " " sen_bill String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	}
} Main
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 man_bill = -1;
		int gosen_bill = -1;
		int sen_bill = -1;
		final int man = 10000;
		final int gosen = 5000;
		final int sen = 1000;
		
		for (int i=0; i<=n; i++) {
			for (int j=0; j+i<=n; j++) {
				int c= n-j-i;
				int tot = i*man + j*gosen + c*sen;
				if (y == tot) {
					man_bill = i;
					gosen_bill = j;
					sen_bill = c;
				}
			}
		}
		
		System.out.println(man_bill + " " + gosen_bill + " " + sen_bill);
	}
}
