#include <bits/stdc++.h>
int n, s, c[6], k[6], v[6], m[6], t, ans(0x7FFFFFFF);
int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }
int main() {
  for (scanf("%d%d", &n, &s); n--;) scanf("%d", &t), c[t]++;
  for (k[3] = s / (c[3] + c[4] + c[5]); k[3] >= 0; k[3]--) {
    m[3] = c[3] * k[3];
    for (k[4] = (s - m[3]) / (c[4] + c[5]); k[4] >= k[3]; k[4]--) {
      m[4] = c[4] * k[4];
      if ((s - m[3] - m[4]) % c[5] == 0) break;
    }
    int step = c[5] / gcd(c[4], c[5]);
    for (; k[4] >= k[3]; k[4] -= step) {
      m[4] = c[4] * k[4];
      k[5] = (s - m[3] - m[4]) / c[5];
      m[5] = c[5] * k[5];
      if (m[5] - m[4] >= ans) break;
      if (m[5] - m[4] + m[3] - m[4] >= ans) break;
      int cur = abs(m[3] - m[4]) + abs(m[4] - m[5]);
      if (cur < ans) ans = cur, v[3] = k[3], v[4] = k[4], v[5] = k[5];
    }
  }
  if (ans == 0x7FFFFFFF)
    printf("-1");
  else
    printf("%d %d %d", v[3], v[4], v[5]);
}
