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 a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	}
} 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 a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int y = sc.nextInt();

		int a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int y = sc.nextInt();

		int a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	} 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 a = -1 a -1 1 b = -1 b -1 1 c = -1; c -1 1 System.out.println(a + " " + b + " " + c) System.out.println System.out System System.out a + " " + b + " " + c " " b a + " " + b + " " + c a " " b " " c sc.close() sc.close sc 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 a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int y = sc.nextInt();

		int a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	}
} 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 a = -1, b = -1, c = -1;

		loop: for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				int mny = i * 10000 + j * 5000 + (n - i - j) * 1000;
				if (mny == y) {
					a = i;
					b = j;
					c = n - i - j;
					break loop;
				}
			}
		}

		System.out.println(a + " " + b + " " + c);

		sc.close();
	}
}