import std.functional,
       std.algorithm,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  int[] NY = readln.chomp.split.to!(int[]);
  int N = NY[0],
      Y = NY[1] / 1000;

  foreach (int i; 0..N+1) {
    foreach (int j; 0..N+1) {
      int k = N - i - j;
      if (k < 0) { continue; }
      int t = i + j*5 + k*10;
      if (t == Y)  {
        writefln("%d %d %d", k, j, i);
        return;
      }
    }
  }

  writeln("-1 -1 -1");
}
