import 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();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

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

  public static void main (String[] args) {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

} Main public static void main (String[] args) {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  } main {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  } 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 sc.close() sc.close sc String result = "-1 -1 -1"; result "-1 -1 -1" for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    } {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    } for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      } int j = 0; int j = 0; j 0 j <= N - i j N - i N i j++ j++ j {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      } {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      } int k = N - i - j; k N - i - j N - i - j N i j int sum = i * 10000 + j * 5000 + k * 1000; sum i * 10000 + j * 5000 + k * 1000 i * 10000 + j * 5000 + k * 1000 i * 10000 i 10000 j * 5000 j 5000 k * 1000 k 1000 if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        } sum == Y && 0 <= k sum == Y sum Y 0 <= k 0 k {
          result = i + " " + j + " " + k;
          break;
        } result = i + " " + j + " " + k result i + " " + j + " " + k " " j i + " " + j + " " + k i " " j " " k break; System.out.println(result) System.out.println System.out System System.out result 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();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

} public class Main {

  public static void main (String[] args) {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

} Main
import 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();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y && 0 <= k) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

}