#include <bits/stdc++.h>
using namespace std;
const int MODULO = 1000000007;
const int INF = 100000000;
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
int a[3];
int ans_k3, ans_k4, ans_k5;
int ans = INT_MAX;
int n, s;
int f(int k3, int k4, int k5) {
  return abs(k3 * a[0] - k4 * a[1]) + abs(k4 * a[1] - k5 * a[2]);
}
void update(int k3, int k4, int k5) {
  if (ans > f(k3, k4, k5)) {
    ans = f(k3, k4, k5);
    ans_k3 = k3;
    ans_k4 = k4;
    ans_k5 = k5;
  }
}
void setk3k5(int k4) {
  int sum = s - k4 * a[1];
  int g = gcd(a[0], a[2]);
  if (sum % g != 0) return;
  int a4 = k4 * a[1];
  int l = (int)ceil(min(a4, s - 2 * a4) / (double)a[0]);
  int r = (int)floor(max(a4, s - 2 * a4) / (double)a[0]);
  if (l > r) swap(l, r);
  int k3_max = min(a[0] * k4, s - (a[1] + a[2]) * k4) / a[0];
  int k3_min = 0;
  for (int i = max(k3_min, l); i < r; i++) {
    if (i > k3_max) break;
    int a5 = (s - i * a[0] - k4 * a[1]);
    if (a5 % a[2] != 0) continue;
    update(i, k4, a5 / a[2]);
    break;
  }
  for (int i = min(k3_max, l); i >= k3_min; i--) {
    int a5 = (s - i * a[0] - k4 * a[1]);
    if (a5 % a[2] != 0) continue;
    update(i, k4, a5 / a[2]);
    break;
  }
  for (int i = max(k3_min, r); i <= k3_max; i++) {
    int a5 = (s - i * a[0] - k4 * a[1]);
    if (a5 % a[2] != 0) continue;
    update(i, k4, a5 / a[2]);
    break;
  }
}
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x - 3]++;
  }
  for (int i = 0; (i * (a[1] + a[2])) <= s; i++) {
    setk3k5(i);
  }
  if (ans == INT_MAX) {
    puts("-1");
  } else {
    printf("%d %d %d\n", ans_k3, ans_k4, ans_k5);
  }
  return 0;
}
