#include <bits/stdc++.h>
using namespace std;
int nav[400005], fin[400005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int N = n;
    for (int i = 1; i <= n; i++) scanf("%d", &nav[i]);
    int con = 0, m = 0;
    for (int i = 1; i <= n + 1; i++) {
      con++;
      if (nav[i] != nav[i - 1]) fin[m++] = con, con = 0;
    }
    n = 2;
    int sum = 0, j = 0;
    nav[1] = fin[1];
    for (int i = 2; i < m; i++) {
      sum += fin[i];
      if (sum > nav[1]) {
        nav[n++] = sum;
        j = i + 1;
        break;
      }
    }
    int TOT = sum + nav[1];
    sum = 0;
    if (n == 3) {
      for (int i = j; i < m; i++) {
        if (TOT + sum + fin[i] > N / 2) {
          nav[n++] = sum;
          break;
        }
        sum += fin[i];
      }
    }
    if (n != 4 || nav[3] == 0 || nav[3] <= nav[1])
      printf("0 0 0");
    else {
      for (int i = 1; i < n; i++) printf("%d ", nav[i]);
    }
    printf("\n");
  }
  return 0;
}
