#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9 + 5;
void min_self(int &a, int b) { a = min(a, b); }
void max_self(int &a, int b) { a = max(a, b); }
void add_self(int &a, int b) { a = (a + b) % mod; }
const int nax = 2e5 + 5;
void print(vector<int> &arr, int i) {
  int n = arr.size();
  for (int j = 0; j < n; j++) {
    if (j == i) continue;
    cout << arr[j] << " ";
  }
  cout << endl;
}
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  int e = 0, o = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1)
      o += (arr[i] == 1);
    else
      e += (arr[i] == 1);
  };
  if (e == o) {
    cout << n << endl;
    for (int i : arr) cout << i << " ";
    cout << endl;
    return;
  }
  cout << n - 1 << endl;
  if (abs(e - o) & 1) {
    int ee = 0, oo = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] == 1) {
        int ko = o - oo - (i & 1);
        int ke = e - ee - (!(i & 1));
        ;
        if (ko + ee == ke + oo) {
          print(arr, i);
          return;
        }
        if (i & 1)
          oo++;
        else
          ee++;
      }
    }
  }
  int ee = 0, oo = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (arr[i] == 0) {
      int ko = o - oo;
      int ke = e - ee;
      if (ko + ee == ke + oo) {
        print(arr, i);
        return;
      }
    }
    if ((i & 1))
      oo += (arr[i] == 1);
    else
      ee += (arr[i] == 1);
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
