import java.util.Scanner;

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

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	} main {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int Y = Integer.parseInt(sc.next()); Y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] result = {-1, -1, -1}; result {-1, -1, -1} -1 1 -1 1 -1 1 for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		} int sen=0; int sen=0; sen 0 sen<=N sen N sen++ sen++ sen {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		} {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		} for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			} int go=0; int go=0; go 0 go<=N-sen go N-sen N sen go++ go++ go {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			} {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			} int sum = sen*1000 + go*5000 + (N-sen-go)*10000; sum sen*1000 + go*5000 + (N-sen-go)*10000 sen*1000 + go*5000 + (N-sen-go)*10000 sen*1000 sen 1000 go*5000 go 5000 (N-sen-go)*10000 (N-sen-go) N-sen-go N sen go 10000 if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				} sum == Y sum Y {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				} result[0] = sen result[0] result 0 sen result[1] = go result[1] result 1 go result[2] = N-sen-go result[2] result 2 N-sen-go N-sen-go N sen go System.out.println(result[2] + " " + result[1] + " " + result[0]) System.out.println System.out System System.out result[2] + " " + result[1] + " " + result[0] " " result[1] result[2] + " " + result[1] + " " + result[0] result[2] result 2 " " result[1] result 1 " " result[0] result 0 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	}
} Main
import java.util.Scanner;

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

		int N = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] result = {-1, -1, -1};
		for(int sen=0; sen<=N; sen++) {
			for(int go=0; go<=N-sen; go++) {
				int sum = sen*1000 + go*5000 + (N-sen-go)*10000;
				if(sum == Y) {
					result[0] = sen;
					result[1] = go;
					result[2] = N-sen-go;
				}
			}
		}

		System.out.println(result[2] + " " + result[1] + " " + result[0]);
	}
}