#include <bits/stdc++.h>
using namespace std;
int ans, i, j, k, n, s, N, c[10], x, I, J, K;
int main() {
  cin >> n >> s;
  while (n--) {
    cin >> x;
    if (x > 2) N++;
    c[x]++;
  }
  ans = 1 << 30;
  for (i = s / N; i >= 0; i--)
    for (j = (s - c[3] * i) / (N - c[3]); j >= i; j--) {
      k = (s - i * c[3] - j * c[4]) / c[5];
      if (k * c[5] - j * c[4] >= ans) break;
      if (j > k || i * c[3] + j * c[4] + k * c[5] != s) continue;
      if (abs(i * c[3] - j * c[4]) + abs(j * c[4] - k * c[5]) < ans)
        ans = abs(i * c[3] - j * c[4]) + abs(j * c[4] - k * c[5]), I = i, J = j,
        K = k;
    }
  if (ans == 1 << 30)
    cout << -1;
  else
    cout << I << " " << J << " " << K;
  return 0;
}
