import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	}
} Main public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	} main {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	} int x x y y z z a a b b c; c Scanner sc = new Scanner(System.in); sc new Scanner(System.in) a = 0 a 0 x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc y = y / 1000 y y / 1000 y 1000 if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

			} else {
				System.out.println(b + " " + a + " " + c);
			}
		} y < x y x {
			System.out.println("-1 -1 -1");
		} System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

			} else {
				System.out.println(b + " " + a + " " + c);
			}
		} y == x y x {
			System.out.println( "0 0 "+y);
		} System.out.println( "0 0 "+y) System.out.println System.out System System.out "0 0 "+y "0 0 " y {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

			} else {
				System.out.println(b + " " + a + " " + c);
			}
		} z = y - x z y - x y x while (z % 9 != 0) {
				z = z - 4;
				a++;

			} z % 9 != 0 z % 9 z 9 0 {
				z = z - 4;
				a++;

			} z = z - 4 z z - 4 z 4 a++ a b = z / 9 b z / 9 z 9 c = x - a - b c x - a - b x - a - b x a b if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

			} else {
				System.out.println(b + " " + a + " " + c);
			} a < 0 || b < 0 || c < 0 a < 0 || b < 0 || c < 0 a < 0 a 0 b < 0 b 0 c < 0 c 0 {
				System.out.println("-1 -1 -1");

			} System.out.println("-1 -1 -1") System.out.println System.out System System.out "-1 -1 -1" {
				System.out.println(b + " " + a + " " + c);
			} System.out.println(b + " " + a + " " + c) System.out.println System.out System System.out b + " " + a + " " + c " " a b + " " + a + " " + c b " " a " " c String[] args args public class Main {

	public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	}
} public class Main {

	public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
			int x, y, z, a, b, c;
		Scanner sc = new Scanner(System.in);
		a = 0;
		x = sc.nextInt();
		y = sc.nextInt();

		y = y / 1000;

		if (y < x) {
			System.out.println("-1 -1 -1");
		} else if (y == x) {
			System.out.println( "0 0 "+y);
		} else {
			z = y - x;
			while (z % 9 != 0) {
				z = z - 4;
				a++;

			}
			// a=a;
			b = z / 9;
			c = x - a - b;

			if (a < 0 || b < 0 || c < 0) {
				System.out.println("-1 -1 -1");

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

	}
}
