import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					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();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					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 long Y = sc.nextLong(); Y sc.nextLong() sc.nextLong sc sc.close() sc.close sc int A = 0; A 0 int B = 0; B 0 int C = 0; C 0 for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		} {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		} A = i * 10000 A i * 10000 i 10000 for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			} int j = 0; int j = 0; j 0 j <= N j N j++ j++ j {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			} {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			} B = j * 5000 B j * 5000 j 5000 C = (N - i - j) * 1000 C (N - i - j) * 1000 (N - i - j) N - i - j N i j 1000 if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				} A + B + C == Y && C >= 0 A + B + C == Y A + B + C A + B + C A B C Y C >= 0 C 0 {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				} System.out.println(i + " " + j + " " + (N - i - j)) System.out.println System.out System System.out i + " " + j + " " + (N - i - j) " " j i + " " + j + " " + (N - i - j) i " " j " " (N - i - j) N - i - j N i j 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();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					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();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					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();
		long Y = sc.nextLong();
		sc.close();
		int A = 0;int B = 0;int C = 0;
		for(int i = 0;i <= N;i++) {
			A = i * 10000;
			for(int j = 0;j <= N;j++) {
				B = j * 5000;
				C = (N - i - j) * 1000;
				if(A + B + C == Y && C >= 0) {
					System.out.println(i + " " + j + " " + (N - i - j));
					return;
				}
			}
		}
		System.out.println("-1 -1 -1");
	}
}