#include <bits/stdc++.h>
using namespace std;
inline long long labs(long long x) { return (x > 0 ? x : -x); }
template <typename T>
inline T sqr(T x) {
  return x * x;
}
long long k3, k4, k5;
long long gcd(long long a, long long b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
bool find_any_solution(long long a, long long b, long long c, long long& x0,
                       long long& y0, long long& g) {
  g = gcd(labs(a), labs(b), x0, y0);
  if (c % g != 0) return false;
  x0 *= c / g;
  y0 *= c / g;
  if (a < 0) x0 *= -1;
  if (b < 0) y0 *= -1;
  return true;
}
double func(long long c3, long long c4, long long c5) {
  long long res = labs(c3 * k3 - c4 * k4);
  res += labs(c4 * k4 - c5 * k5);
  return res;
}
bool found = false;
long long minval = INT_MAX;
long long cc3, cc4, cc5;
void dostuff(long long c3, long long c4, long long c5) {
  minval = func(c3, c4, c5);
  cc3 = c3;
  cc4 = c4;
  cc5 = c5;
  found = true;
}
int main() {
  long long n, s;
  cin >> n >> s;
  for (long long i = 0; i < (n); ++i) {
    char c;
    cin >> c;
    if (c == '3')
      k3++;
    else if (c == '4')
      k4++;
    else
      k5++;
  }
  long long k = k3 + k4 + k5;
  for (long long c3 = 0; c3 <= ceil((s + 0.0) / k); ++c3) {
    if (c3 == 3498) {
      ;
      ;
      long long a = 1;
      ;
      ;
      ;
    }
    long long s0 = s - c3 * k3;
    long long g = 0;
    long long c4, c5;
    if (!find_any_solution(k4, k5, s0, c4, c5, g)) continue;
    long long dc4 = k5 / g;
    long long dc5 = k4 / g;
    long long maxc5 = (s - c3 * k3 - c3 * k4) / k5;
    long long minc4 = c3;
    long long sdvig = ((c4 - c3) / dc4);
    if (c4 - sdvig * dc4 < c3) {
      sdvig++;
    } else {
      sdvig = min(sdvig, (maxc5 - c5) / dc5);
    }
    c5 += sdvig * dc5;
    c4 -= sdvig * dc4;
    if (c5 < c4) continue;
    long long K = (c5 - c4) / (dc4 + dc5) + 1;
    long long CC1 = k3 * c3 - c4 * k4;
    long long CC2 = c4 * k4 - k5 * c5;
    long long CC3 = dc4 * k4 + k5 * dc5;
    CC3 *= -1;
    long long CC4 = k4 * dc4;
    CC4 *= -1;
    long long g1 = CC1 / CC4;
    long long g2 = CC2 / CC3;
    vector<long long> vals;
    vals.push_back(0);
    vals.push_back(g1);
    vals.push_back(g1 + 1);
    vals.push_back(g2);
    vals.push_back(g2 + 1);
    vals.push_back(K - 1);
    for (long long i = 0; i < (vals.size()); ++i) {
      long long j = vals[i];
      if (j < K && j >= 0 && func(c3, c4 + j * dc4, c5 - j * dc5) < minval &&
          c3 <= c4 + j * dc4 && c4 + j * dc4 <= c5 - j * dc5)
        dostuff(c3, c4 + j * dc4, c5 - j * dc5);
    }
  }
  if (!found)
    cout << "-1" << endl;
  else
    cout << cc3 << " " << cc4 << " " << cc5 << endl;
  return 0;
}
