#include <bits/stdc++.h>
using namespace std;
long long int find_ans() {
  long long int i, j, k, s, n, m, l1, l2, r1, r2, x, y, vv, sum1, odd = 0,
                                                                  even = 0;
  vector<long long int> a, b;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> j;
    a.push_back(j);
    if (j == 1) {
      b.push_back(i);
      if (i % 2 == 1)
        odd++;
      else
        even++;
    }
  }
  if (b.size() == 0 || b.size() == n) {
    cout << n << "\n";
    for (i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
    return 1;
  }
  if (b.size() <= n / 2) {
    cout << n / 2 << "\n";
    for (i = 0; i < n / 2; i++) cout << 0 << " ";
    cout << "\n";
    return 1;
  }
  if ((n / 2) % 2 == 0) {
    cout << n / 2 << "\n";
    for (i = 0; i < n / 2; i++) cout << 1 << " ";
    cout << "\n";
    return 1;
  } else {
    cout << n / 2 + 1 << "\n";
    for (i = 0; i < n / 2 + 1; i++) cout << 1 << " ";
    cout << "\n";
    return 1;
  }
}
int32_t main() {
  long long int g, t, i;
  vector<long long int> ans;
  cin >> t;
  for (g = 0; g < t; g++) i = find_ans();
  return 0;
}
