import std.array;
import std.algorithm;
import std.range;
import std.stdio;
import std.c.stdio : scanf;

void main() {
  int n, y;
  scanf("%d %d", &n, &y);
  for (int i = 0; i <= y / 10000 && i <= n; ++i) {
    for (int j = 0; j <= y / 5000 && i + j <= n; ++j) {
      int k = n - i - j;
      if (i * 10000 + j * 5000 + k * 1000 == y) {
        writef("%d %d %d", i, j, k);
        return;
      }      
    }
  }
  write("-1 -1 -1");
}