import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	} main {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int Y = scan.nextInt(); Y scan.nextInt() scan.nextInt scan for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		} int x=0; int x=0; x 0 x<=N x N x++ x++ x {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		} {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		} for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			} int y=0; int y=0; y 0 y<=N-x y N-x N x y++ y++ y {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			} {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			} int total = x*10000 + y*5000 + 1000*(N-x-y); total x*10000 + y*5000 + 1000*(N-x-y) x*10000 + y*5000 + 1000*(N-x-y) x*10000 x 10000 y*5000 y 5000 1000*(N-x-y) 1000 (N-x-y) N-x-y N x y if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				} total==Y total Y {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				} System.out.println(x+" "+y+" "+(N-x-y)) System.out.println System.out System System.out x+" "+y+" "+(N-x-y) " " y x+" "+y+" "+(N-x-y) x " " y " " (N-x-y) N-x-y N x y return; System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		
		for(int x=0;x<=N;x++) {
			for(int y=0;y<=N-x;y++) {
				int total = x*10000 + y*5000 + 1000*(N-x-y);
				if(total==Y) {
					System.out.println(x+" "+y+" "+(N-x-y));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
}