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();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  }

} 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();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  }

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

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int Y = sc.nextInt();

    sc.close();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  } main {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int Y = sc.nextInt();

    sc.close();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  } 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 int x = -1; x -1 1 int y = -1; y -1 1 int z = -1; z -1 1 for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        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 i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    } {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    } for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = 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 i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      } {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      } int k = N - i - j; k N - i - j N - i - j N i j int i_ = 10000 * i; i_ 10000 * i 10000 i int j_ = 5000 * j; j_ 5000 * j 5000 j int k_ = 1000 * k; k_ 1000 * k 1000 k if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        } i_ + j_ + k_ == Y i_ + j_ + k_ i_ + j_ + k_ i_ j_ k_ Y {
          x = i;
          y = j;
          z = k;
          break;
        } x = i x i y = j y j z = k z k break; if (x != -1) {
        break;
      } x != -1 x -1 1 {
        break;
      } break; System.out.println(x + " " + y + " " + z) System.out.println System.out System System.out x + " " + y + " " + z " " y x + " " + y + " " + z x " " y " " z 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();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  }

} 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();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  }

} 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();

    int x = -1;
    int y = -1;
    int z = -1;

    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N - i; j++) {
        int k = N - i - j;
        int i_ = 10000 * i;
        int j_ = 5000 * j;
        int k_ = 1000 * k;
        if (i_ + j_ + k_ == Y) {
          x = i;
          y = j;
          z = k;
          break;
        }
      }
      if (x != -1) {
        break;
      }
    }

    System.out.println(x + " " + y + " " + z);

  }

}