import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    }
} import java.util.*; util.* java import java.util.function.*; function.* java.util import java.math.*; math.* java public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    }
} Main public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    } main {
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = s.nextInt(); N s.nextInt() s.nextInt s long Y = s.nextLong(); Y s.nextLong() s.nextLong s for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		} int man = 0; int man = 0; man 0 man < N + 1 man N + 1 N 1 man++ man++ man {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		} {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		} for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			} int gosen = 0; int gosen = 0; gosen 0 gosen < N + 1 gosen N + 1 N 1 gosen++ gosen++ gosen {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			} {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			} if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				} 0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen) 0 <= Y - man*10000 - gosen*5000 0 Y - man*10000 - gosen*5000 Y - man*10000 - gosen*5000 Y man*10000 man 10000 gosen*5000 gosen 5000 (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen) (Y - man*10000 - gosen*5000)/1000 (Y - man*10000 - gosen*5000) Y - man*10000 - gosen*5000 Y man*10000 man 10000 gosen*5000 gosen 5000 1000 (N - man - gosen) N - man - gosen N man gosen {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				} System.out.print(man + " ") System.out.print System.out System System.out man + " " man " " System.out.print(gosen + " ") System.out.print System.out System System.out gosen + " " gosen " " System.out.println(N - man - gosen) System.out.println System.out System System.out N - man - gosen N - man - gosen N man gosen 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 s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    }
} public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    }
} Main
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		long Y = s.nextLong();
		
		for(int man = 0; man < N + 1; man++) {
			for(int gosen = 0; gosen < N + 1; gosen++) {
				if(0 <= Y - man*10000 - gosen*5000 && (Y - man*10000 - gosen*5000)/1000 == (N - man - gosen)) {
					System.out.print(man + " ");
					System.out.print(gosen + " ");
					System.out.println(N - man - gosen);
					return;
				}
			}
		}
		
		System.out.println("-1 -1 -1");
    }
}
