#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
const long long maxN = 1e5 + 10, maxE = 5200, maxK = 1e4 + 10, inf = 1e15 + 10,
                mod = 1e9 + 7, base = 223;
const double eps = 0.00000001;
long long t, n, a[maxN];
void solve() {
  cin >> t;
  while (t--) {
    cin >> n;
    long long q = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 1) q++;
    }
    if (q <= n / 2) {
      cout << n / 2 << '\n';
      for (long long i = 0; i < n / 2; i++) {
        cout << 0 << " ";
      }
    } else {
      cout << n / 2 + (n / 2) % 2 << '\n';
      for (long long i = 0; i < n / 2 + (n / 2) % 2; i++) {
        cout << 1 << " ";
      }
    }
    cout << '\n';
  }
}
