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 = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		}

	} 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 = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		}

	} Main public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);

			int n = sc.nextInt();
			int y = sc.nextInt();
			int man = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		} main {

			Scanner sc = new Scanner(System.in);

			int n = sc.nextInt();
			int y = sc.nextInt();
			int man = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		} 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 = 10000; man 10000 int go = 5000; go 5000 int sen = 1000; sen 1000 String no = "-1 -1 -1"; no "-1 -1 -1" if(y>man*n) {
				System.out.println(no);
				return;
			} y>man*n y man*n man n {
				System.out.println(no);
				return;
			} System.out.println(no) System.out.println System.out System System.out no return; for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			} int i=0; int i=0; i 0 i<=y/man i y/man y man i++ i++ i {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			} {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			} int x = ((y-man*i)/sen+i-n); x ((y-man*i)/sen+i-n) (y-man*i)/sen+i (y-man*i)/sen (y-man*i) y man*i man i sen i n if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				} x%4==0&&(n-x/4-i>=0)&&x/4>=0 x%4==0&&(n-x/4-i>=0)&&x/4>=0 x%4==0 x%4 x 4 0 (n-x/4-i>=0) n-x/4-i n-x/4-i n x/4 x 4 i 0 x/4>=0 x/4 x 4 0 {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				} System.out.println(i+" "+x/4+" "+(n-i-x/4)) System.out.println System.out System System.out i+" "+x/4+" "+(n-i-x/4) " " x/4 i+" "+x/4+" "+(n-i-x/4) i " " x/4 x 4 " " (n-i-x/4) n-i-x/4 n i x/4 x 4 return; System.out.println(no) System.out.println System.out System System.out no 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 = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		}

	} 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 = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		}

	} 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 = 10000;
			int go = 5000;
			int sen = 1000;
			
			
			String no = "-1 -1 -1";
			
			if(y>man*n) {
				System.out.println(no);
				return;
			}
			
			for(int i=0;i<=y/man;i++) {
				int x = ((y-man*i)/sen+i-n);
				if(x%4==0&&(n-x/4-i>=0)&&x/4>=0) {
					System.out.println(i+" "+x/4+" "+(n-i-x/4));
					return;
					
				}
			}
			
			System.out.println(no);
		}

	}
