#include <bits/stdc++.h>
int r3, r4, r5;
int c3, c4, c5;
int s;
int jdz(int a) {
  if (a < 0)
    return -a;
  else
    return a;
}
void update(int x3, int x4, int x5) {
  if (r3 == -1) {
    r3 = x3;
    r4 = x4;
    r5 = x5;
  } else if (jdz(c3 * x3 - c4 * x4) + jdz(c4 * x4 - c5 * x5) <
             jdz(c3 * r3 - c4 * r4) + jdz(c4 * r4 - c5 * r5)) {
    r3 = x3;
    r4 = x4;
    r5 = x5;
  }
}
int gcd(int a, int b, int &x, int &y) {
  if (a % b == 0) {
    x = 0;
    y = 1;
    return b;
  } else {
    int tx, ty;
    int t = gcd(b, a % b, tx, ty);
    x = ty;
    y = tx - (a / b) * ty;
    return t;
  }
}
void init() {
  int i, n, x;
  r3 = r4 = r5 = -1;
  scanf("%d%d", &n, &s);
  c3 = c4 = c5 = 0;
  for (i = 1; i <= n; ++i) {
    scanf("%d", &x);
    if (x == 3)
      ++c3;
    else if (x == 4)
      ++c4;
    else
      ++c5;
  }
}
void work() {
  int i, j, k, t, d3, d4, d5, d, x3, x4, x5, step, bigstep, x3p, x5p;
  d = gcd(c3, c5, x3p, x5p);
  for (x4 = 0; x4 <= s / c4; ++x4) {
    k = s - c4 * x4;
    if (k % d != 0) continue;
    x3 = x3p * (k / d);
    x5 = x5p * (k / d);
    if (x3 >= 0) {
      t = x3 / (c5 / d);
      x3 -= t * (c5 / d);
      x5 += t * (c3 / d);
    } else {
      t = (-x3) / (c5 / d);
      x3 += t * (c5 / d);
      if (x3 < 0) {
        x3 += c5 / d;
        ++t;
      }
      x5 -= t * (c3 / d);
    }
    if (((x3 <= x4) && (x4 <= x5))) {
      d3 = x3 * c3;
      d4 = x4 * c4;
      d5 = x5 * c5;
      if ((d3 <= d4) && (d4 <= d5)) {
        step = (x4 - x3) / (c5 / d);
        if ((x5 - x4) / (c3 / d) < step) step = (x5 - x4) / (c3 / d);
        bigstep = c3 / d * c5;
        t = (d4 - d3) / bigstep;
        if ((d5 - d4) / bigstep < t) t = (d5 - d4) / bigstep;
        if (step < t) t = step;
        update(x3 + t * (c5 / d), x4, x5 - t * (c3 / d));
        if (t + 1 <= step)
          update(x3 + (t + 1) * (c5 / d), x4, x5 - (t + 1) * (c3 / d));
      } else
        update(x3, x4, x5);
    }
  }
}
void output() {
  if (r3 == -1)
    printf("-1\n");
  else
    printf("%d %d %d\n", r3, r4, r5);
}
int main() {
  init();
  work();
  output();
  return 0;
}
