#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 30;
int c[6];
int n, s;
void solve() {
  int i, j, k, t, ii, jj, kk, tt, s1, s2;
  t = oo;
  for (i = s / n; i >= 0; i--) {
    s1 = i * c[3];
    for (j = min((s - s1) / (c[4] + c[5]), (t + s1) / c[4]); j >= i; j--) {
      s2 = j * c[4];
      if (s1 - s2 >= t) break;
      k = (s - s1 - s2) / c[5];
      if (k * c[5] - s2 >= t) break;
      if (s1 + s2 + k * c[5] == s && k >= j) {
        tt = abs(s1 - s2) + abs(s2 - k * c[5]);
        if (tt < t) {
          t = tt;
          ii = i;
          jj = j;
          kk = k;
        }
      }
    }
  }
  if (t == oo)
    printf("-1\n");
  else
    printf("%d %d %d\n", ii, jj, kk);
}
int main() {
  int i, k;
  scanf("%d%d", &n, &s);
  memset(c, 0, sizeof(c));
  for (i = 0; i < n; i++) {
    scanf("%d", &k);
    c[k]++;
  }
  solve();
  return 0;
}
