import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      }
    } import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      }
    } Main public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      } main {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int y = scan.nextInt(); y scan.nextInt() scan.nextInt scan int bill10000=-1; bill10000 -1 1 int bill5000=-1; bill5000 -1 1 int bill1000=-1; bill1000 -1 1 for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        } {
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        } for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          } int j=0; int j=0; j 0 j+i<=n j+i j i n j++ j++ j {
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          } {
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          } int k = n-i-j; k n-i-j n-i-j n i j if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          } i*10000+j*5000+k*1000==y i*10000+j*5000+k*1000 i*10000+j*5000+k*1000 i*10000 i 10000 j*5000 j 5000 k*1000 k 1000 y {
          bill10000=i;
          bill5000=j;
          bill1000=k;
          } bill10000=i bill10000 i bill5000=j bill5000 j bill1000=k bill1000 k System.out.println(bill10000+" "+bill5000+" "+bill1000) System.out.println System.out System System.out bill10000+" "+bill5000+" "+bill1000 " " bill5000 bill10000+" "+bill5000+" "+bill1000 bill10000 " " bill5000 " " bill1000 String[] args args public class Main {

    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      }
    } public class Main {

    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      }
    } Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      int y = scan.nextInt();

      int bill10000=-1;
      int bill5000=-1;
      int bill1000=-1;
      for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
          int k = n-i-j;
          if(i*10000+j*5000+k*1000==y){
          bill10000=i;
          bill5000=j;
          bill1000=k;
          }
          }
        }

        System.out.println(bill10000+" "+bill5000+" "+bill1000);
      }
    }
