
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			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 x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			System.out.println(-1 + " " + -1 + " " + -1);
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			System.out.println(-1 + " " + -1 + " " + -1);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			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 x = sc.nextInt(); x sc.nextInt() sc.nextInt sc boolean ans = false; ans false int i = 0; i 0 int j = 0; j 0 if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		} x % 1000 == 0 x % 1000 x 1000 0 {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		} x = x / 1000 x x / 1000 x 1000 for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			} i = 0; i = 0 i 0 i < n + 1 i n + 1 n 1 i++ i++ i {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			} {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			} for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				} j = 0; j = 0 j 0 j < n + 1 - i j n + 1 - i n + 1 n 1 i j++ j++ j {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				} {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				} if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					} x == i + j * 5 + (n - i - j) * 10 x i + j * 5 + (n - i - j) * 10 i + j * 5 + (n - i - j) * 10 i j * 5 j 5 (n - i - j) * 10 (n - i - j) n - i - j n i j 10 {
						ans = true;
						break;
					} ans = true ans true break; if(ans)
					break; ans break; if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			System.out.println(-1 + " " + -1 + " " + -1);
		} ans {
			System.out.println((n - i - j) + " " + j + " " + i);
		} System.out.println((n - i - j) + " " + j + " " + i) System.out.println System.out System System.out (n - i - j) + " " + j + " " + i " " j (n - i - j) + " " + j + " " + i (n - i - j) n - i - j n i j " " j " " i {
			System.out.println(-1 + " " + -1 + " " + -1);
		} System.out.println(-1 + " " + -1 + " " + -1) System.out.println System.out System System.out -1 + " " + -1 + " " + -1 " " -1 -1 + " " + -1 + " " + -1 -1 1 " " -1 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 x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			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 x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			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 x = sc.nextInt();
		boolean ans = false;
		int i = 0;
		int j = 0;
		if(x % 1000 == 0) {
			x = x / 1000;
			for(i = 0; i < n + 1; i++) {
				for(j = 0; j < n + 1 - i; j++) {
					if(x == i + j * 5 + (n - i - j) * 10) {
						ans = true;
						break;
					}
				}
				if(ans)
					break;
			}
		}
		if(ans) {
			System.out.println((n - i - j) + " " + j + " " + i);
		} else {
			System.out.println(-1 + " " + -1 + " " + -1);
		}
	}

}
