#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
int n, s, p, a, b, c;
int t1, t2, t3, ans = INF;
inline int gcd(int x, int y) { return (y == 0) ? x : gcd(y, x % y); }
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p);
    if (p == 3)
      a++;
    else if (p == 4)
      b++;
    else if (p == 5)
      c++;
  }
  int gg = gcd(b, c);
  for (int i = s / (a + b + c); i >= 0; i--) {
    if ((s - a * i) % gg) continue;
    for (int j = (s - i * a) / (b + c); j >= i; j--) {
      int pq = s - a * i - b * j;
      if (pq % c) continue;
      int z = pq / c;
      if (z < j) break;
      if (c * z >= b * j && abs(a * i - b * j) + (c * z - b * j) > ans) break;
      if (ans > abs(a * i - b * j) + abs(b * j - c * z)) {
        ans = abs(a * i - b * j) + abs(b * j - c * z);
        t1 = i, t2 = j, t3 = z;
      }
    }
  }
  if (ans == INF) {
    puts("-1");
    return 0;
  }
  printf("%d %d %d", t1, t2, t3);
}
