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();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	}
} 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();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	} 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 Y/=1000 Y 1000 int a=-1 a -1 1 b=-1 b -1 1 c=-1 c -1 1 flag=0; flag 0 for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		} int i=0; int i=0; i 0 i<=N i N i++ i++ i {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		} {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		} for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			} int j=0; int j=0; j 0 i+j<=N i+j i j N j++ j++ j {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			} {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			} int k = N-i-j; k N-i-j N-i-j N i j if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				} i*10+j*5+k==Y i*10+j*5+k i*10+j*5+k i*10 i 10 j*5 j 5 k Y {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				} a=i a i b=j b j c=k c k flag=1 flag 1 break; if(flag==1) break; flag==1 flag 1 break; System.out.printf("%d %d %d\n",a,b,c) System.out.printf System.out System System.out "%d %d %d\n" a b c 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();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	}
} 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();
		Y/=1000;
		int a=-1,b=-1,c=-1,flag=0;
		for(int i=0;i<=N;i++) {
			for(int j=0;i+j<=N;j++) {
				int k = N-i-j;
				if(i*10+j*5+k==Y) {
					a=i;
					b=j;
					c=k;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
		System.out.printf("%d %d %d\n",a,b,c);
	}
}