#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int zc = 0, oc = 0;
    for (long long int i = 0; i < n; i++) {
      long long int x;
      cin >> x;
      if (x == 0)
        zc++;
      else
        oc++;
    }
    int fnum, k;
    if (oc % 2 == 0 && zc % 2 == 0) {
      fnum = (zc > oc) ? 0 : 1;
      if (zc > oc) {
        k = zc;
      } else
        k = oc;
    } else {
      if (oc == zc) {
        k = zc;
        fnum = 0;
      } else {
        fnum = (zc > oc) ? 0 : 1;
        if (fnum == 0) {
          k = zc - 1;
        } else {
          k = oc - 1;
        }
      }
    }
    cout << k << "\n";
    for (long long int i = 0; i < k; i++) {
      cout << fnum << " ";
    }
    cout << "\n";
  }
  return 0;
}
