#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const long long inf = 0x3f3f3f3f3f3f3f3f;
int n, s, c3, c4, c5;
void init() {
  read(n);
  read(s);
  for (int i = 1, x; i <= n; ++i) {
    read(x);
    if (x == 3)
      c3++;
    else if (x == 4)
      c4++;
    else
      c5++;
  }
}
int exgcd(int a, int b, int &x, int &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  int d = exgcd(b, a % b, y, x);
  y -= (a / b) * x;
  return d;
}
long long Floor(long long x, long long y) {
  if (x % y == 0) return x / y;
  if (x > 0)
    return x / y;
  else
    return x / y - 1;
}
long long Ceil(long long x, long long y) {
  if (x % y == 0) return x / y;
  if (x < 0)
    return x / y;
  else
    return x / y + 1;
}
void solve() {
  int x, y;
  long long g = exgcd(c5, c3, x, y);
  long long X = x, Y = -y;
  long long d1 = c3 / g, d2 = c5 / g;
  int K3 = 0, K4 = 0, K5 = 0;
  long long ans = inf;
  for (int k4 = 0; k4 <= s; ++k4) {
    if (c4 * k4 >= s) break;
    long long P = (long long)(c3 - c4 - n) * k4 + s;
    long long Q = (long long)(c4 - c5) * k4;
    if (P > Q) swap(P, Q);
    long long C = s - (long long)n * k4;
    if (C % g) continue;
    C /= g;
    long long R = Floor(k4 - Y * C, d2);
    long long L = _max(Ceil(-X * C, d1), Ceil(-Y * C, d2));
    if (L > R) continue;
    auto calc = [&](long long i) {
      long long nB = X * C + i * d1, nA = Y * C + i * d2;
      long long num = abs(c5 * nB - P) + abs(c5 * nB - Q);
      return num;
    };
    long long l = L, r = R;
    while (l + 3 < r) {
      long long w1 = l + (r - l) / 3, w2 = r - (r - l) / 3;
      if (calc(w1) < calc(w2))
        r = w2;
      else
        l = w1;
    }
    for (int i = l; i <= r; ++i) {
      if (checkmin(ans, calc(i))) {
        long long nB = X * C + i * d1, nA = Y * C + i * d2;
        K4 = k4;
        K3 = k4 - nA;
        K5 = k4 + nB;
      }
    }
  }
  if (ans == inf)
    printf("-1\n");
  else
    printf("%d %d %d\n", K3, K4, K5);
}
int main() {
  init();
  solve();
  return 0;
}
