#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  int n, x, sum = 0, *p, count = 0, second, t;
  cin >> t;
  for (int aa = 0; aa < 5; aa++) {
    sum = 0, count = 0;
    cin >> n;
    p = new int[n];
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (m.find(x) == m.end()) {
        m[x] = 1;
        p[count] = x;
        count++;
      } else {
        m[x] += 1;
      }
    }
    x = -1;
    while (sum <= floor(n / 2)) {
      ++x;
      sum += m[p[x]];
    }
    --x;
    if (x <= 2) {
      cout << 0 << " " << 0 << " " << 0 << endl;
      continue;
    }
    int y = x;
    int b = 1;
    sum = 0;
    while (b < x) {
      if (sum > m[p[0]]) break;
      sum += m[p[b]];
      ++b;
    }
    if (sum < m[p[0]]) {
      cout << 0 << " " << 0 << " " << 0 << endl;
      continue;
    } else {
      second = sum;
    }
    sum = 0;
    while (b <= x) {
      sum += m[p[b]];
      ++b;
    }
    if (sum < m[p[0]]) {
      cout << 0 << " " << 0 << " " << 0 << endl;
      continue;
    }
    cout << m[p[0]] << " " << second << " " << sum << endl;
  }
  return 0;
}
