#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5;
const long long INF = 1e9 + 7;
void solve() {
  int n, x;
  cin >> n;
  vector<int> a;
  int s1 = 0, s2 = 0;
  for (int i = 0; i < (int)n; i++) {
    cin >> x;
    a.push_back(x);
    if (x == 1) i % 2 == 0 ? s2++ : s1++;
  }
  vector<int> v;
  int k;
  if (s1 == s2) {
    v = a;
    k = n;
  } else if (s1 + s2 > (n / 2)) {
    k = n / 2;
    k % 2 == 0 ? k : k += 1;
    for (int i = 1; i <= (int)k; i++) v.push_back(1);
  } else {
    k = n / 2;
    for (int i = 1; i <= (int)n / 2; i++) v.push_back(0);
  }
  cout << k << "\n";
  for (auto u : v) cout << u << " ";
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
