#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-7;
int gcd(int a, int b) {
  for (int tmp = a % b; tmp != 0; tmp = a % b) {
    a = b;
    b = tmp;
  }
  return b;
}
int main() {
  int n, s;
  scanf("%d %d", &n, &s);
  int c3 = 0, c4 = 0, c5 = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (a == 3) c3++;
    if (a == 4) c4++;
    if (a == 5) c5++;
  }
  int res = (1 << 29);
  int a3 = -1, a4 = -1, a5 = -1;
  for (int k3 = s / n; k3 >= 0; k3--) {
    int r3 = k3 * c3;
    if ((s - r3) % gcd(c4, c5) != 0) continue;
    for (int k4 = (s - r3) / (c4 + c5); k4 >= k3; k4--) {
      int r4 = c4 * k4;
      int k5 = (s - r3 - r4) / c5;
      int r5 = c5 * k5;
      if (r5 - r4 > res || r3 - r4 > res || r5 + r3 - r4 - r4 > res) break;
      if (r3 + r4 + r5 != s) continue;
      if (abs(r3 - r4) + abs(r4 - r5) < res) {
        res = abs(r3 - r4) + abs(r4 - r5);
        a3 = k3, a4 = k4, a5 = k5;
      }
    }
  }
  if (res == (1 << 29))
    puts("-1");
  else
    printf("%d %d %d\n", a3, a4, a5);
  return 0;
}
