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();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	}
} 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();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	} 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 a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		} int a = 0; int a = 0; a 0 a <= n a n a++ a++ a {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		} {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		} for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			} int b = 0; int b = 0; b 0 b <= n b n b++ b++ b {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			} {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			} int c = n - a - b; c n - a - b n - a - b n a b int total = a * 10000 + b * 5000 + c * 1000; total a * 10000 + b * 5000 + c * 1000 a * 10000 + b * 5000 + c * 1000 a * 10000 a 10000 b * 5000 b 5000 c * 1000 c 1000 if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				} total == y && c >= 0 total == y total y c >= 0 c 0 {
					System.out.println(a + " " + b + " " + c);
					return;
				} System.out.println(a + " " + b + " " + c) System.out.println System.out System System.out a + " " + b + " " + c " " b a + " " + b + " " + c a " " b " " c 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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	}
} 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();

		for(int a = 0; a <= n; a++) {
			for(int b = 0; b <= n; b++) {
				int c = n - a - b;
				int total = a * 10000 + b * 5000 + c * 1000;
				if(total == y && c >= 0) {
					System.out.println(a + " " + b + " " + c);
					return;
				}
			}
		}

		System.out.println("-1 -1 -1");
	}
}