#include <bits/stdc++.h>
using namespace std;
int x, y, z, t, q, w, e;
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) {
    int score;
    scanf("%d", &score);
    if (score == 3) {
      x++;
    } else {
      if (score == 4) {
        y++;
      } else {
        if (score == 5) {
          z++;
        }
      }
    }
  }
  int ans = 2147483647 / 2;
  for (int i = s / n; i >= 0; i--) {
    for (int j = (s - i * x) / (z + y); j >= i; j--) {
      t = (s - i * x - j * y) / z;
      if (t * z - j * y >= ans) {
        break;
      }
      if ((abs(i * x - j * y) + abs(j * y - t * z) < ans) &&
          (i * x + j * y + t * z == s)) {
        ans = abs(i * x - j * y) + abs(j * y - t * z);
        q = i;
        w = j;
        e = t;
      }
    }
  }
  if (ans == 2147483647 / 2) {
    puts("-1");
  } else {
    printf("%d %d %d", q, w, e);
  }
  return 0;
}
