#include <bits/stdc++.h>
using namespace std;
int n, s, v, k3, k4, k5, c3, c4, c5, ans;
int i, j, k;
int abs(int x) { return x < 0 ? -x : x; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  scanf("%d%d", &n, &s);
  for (i = 1; i <= n; ++i) {
    scanf("%d", &v);
    if (v == 3)
      ++c3;
    else if (v == 4)
      ++c4;
    else
      ++c5;
  }
  ans = 1 << 30;
  int d, dt = c5 / gcd(c4, c5);
  for (i = s / n; i >= 0; --i) {
    d = 1;
    if ((s - c3 * i) % gcd(c4, c5) != 0) continue;
    for (j = min((s - i * c3) / (n - c3), (i * c3 + ans) / c4); j >= i;
         j -= d) {
      k = (s - i * c3 - j * c4) / c5;
      if (k * c5 - j * c4 >= ans) break;
      if (i * c3 + j * c4 + k * c5 == s)
        d = dt;
      else
        continue;
      if (abs(i * c3 - j * c4) + abs(j * c4 - k * c5) <= ans) {
        ans = abs(i * c3 - j * c4) + abs(j * c4 - k * c5);
        k3 = i, k4 = j, k5 = k;
      }
    }
  }
  if (ans == 1 << 30)
    printf("%d\n", -1);
  else
    printf("%d %d %d\n", k3, k4, k5);
  return 0;
}
