#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int T, i, j, x, n, oddsum, evensum, count1, k;
  cin >> T;
  for (x = 0; x < T; x++) {
    oddsum = evensum = count1 = 0;
    cin >> n;
    n++;
    long long int a[n];
    for (i = 1; i < n; i++) cin >> a[i];
    for (i = 1, j = 2; i < n; j += 2, i += 2) {
      oddsum = oddsum + a[i];
      evensum = evensum + a[j];
      if (oddsum > evensum) {
        a[i] = -1;
        oddsum--;
        count1++;
      } else if (evensum > oddsum) {
        a[j] = -1;
        evensum--;
        count1++;
      }
    }
    k = (n - 1) - count1;
    printf("%lld\n", k);
    for (i = 1; i < n; i++) {
      if (a[i] != -1) {
        printf("%lld ", a[i]);
      }
    }
    printf("\n");
  }
  return 0;
}
