#include <bits/stdc++.h>
using namespace std;
void make_unique(vector<long long> vec) {
  sort((vec).begin(), (vec).end());
  vec.resize(unique((vec).begin(), (vec).end()) - vec.begin());
}
bool isPrime(long long n) {
  if (n == 1) return false;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long l, k, p, a, b, c, n, m, i, j, flag = 0, count = 0, move = 0;
    cin >> n;
    long long A[n];
    for (i = 0; i < n; i++) cin >> A[i];
    long long c0 = 0, c1 = 0;
    for (i = 0; i < n; i++) {
      if (A[i] == 0)
        c0++;
      else
        c1++;
    }
    if (c1 <= n / 2) {
      cout << n - c1 << '\n';
      for (i = 0; i < n; i++) {
        if (A[i] == 0) cout << A[i] << " ";
      }
    } else if (c0 <= n / 2) {
      if (c1 % 2 == 0)
        cout << c1 << '\n';
      else if (c1 % 2 == 1)
        cout << c1 - 1 << '\n';
      if (c1 % 2 == 0) {
        for (i = 0; i < n; i++) {
          if (A[i] == 1) cout << A[i] << " ";
        }
      } else if (c1 % 2 == 1) {
        for (i = 0; i < c1 - 1; i++) cout << 1 << " ";
      }
    }
    cout << '\n';
  }
  return 0;
}
