#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long M = 1000000007;
const long long INF = 1e12;
const long long N = 100005;
const long int maxi = 1000000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n, i, j, po, pox, point;
  cin >> t;
  while (t--) {
    long long z = 0;
    cin >> n;
    long long p[n], x = 0;
    pair<long long, long long> a[n];
    j = 0;
    for (long long i = 0; i < n; i++) {
      cin >> p[i];
      if (i > 0) {
        if (p[i] != p[i - 1]) {
          a[j].first = p[i - 1];
          a[j].second = x + 1;
          x = 0;
          j++;
        } else {
          x++;
        }
      }
      if (i + 1 == n / 2) {
        po = p[i];
        pox = i;
      }
    }
    a[j].first = p[n - 1];
    a[j].second = x + 1;
    if (j + 1 < 3) {
      z++;
    } else {
      if (p[pox] == p[pox + 1]) {
        point = po + 1;
      } else {
        point = po;
      }
      i = 0;
      long long s = 0, sum = 0;
      cout << point << endl;
      while (a[i].first >= point) {
        s = s + a[i].second;
        i++;
      }
      if (i >= 3) {
        if (2 * a[0].second < s - a[0].second) {
          j = i - 1;
          while (sum <= a[0].second) {
            sum = sum + a[j].second;
            j--;
          }
          if (s - sum - a[0].second <= a[0].second) {
            z++;
          } else {
            cout << a[0].second << " " << s - sum - a[0].second << " " << sum
                 << endl;
          }
        } else {
          z++;
        }
      } else {
        z++;
      }
    }
    if (z > 0) {
      cout << "0"
           << " "
           << "0"
           << " "
           << "0" << endl;
    }
  }
}
