import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;

void main() {
  int N, Y;
  auto l = readln.chomp.split.map!(to!int).array;

  N = l[0], Y = l[1];

  for (int i = 0; i <= N; ++i) {
    for (int j = 0; j <= N - i; ++j) {
      int k = N - i - j;
      int sum = 10000 * i + 5000 * j + 1000 * k;

      if (sum == Y) {
        writeln(i, " ", j, " ", k);
        return;
      }
    }
  }

  writeln(-1, " ", -1, " ", -1);

  return;
}