#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
long long binPow(long long a, long long b) {
  if (b == 0) return 1;
  long long ans = binPow(a, b / 2);
  ans = ans * ans % MOD;
  if (b % 2) ans = ans * a % MOD;
  return ans;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  int num = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    num += a[i];
  }
  if (num >= n / 2 && ((n / 2) % 2 == 0) || (num > n / 2)) {
    cout << n / 2 + (n / 2 % 2) << "\n";
    for (int i = 0; i < n / 2 + (n / 2 % 2); ++i) cout << "1 ";
  } else {
    cout << n / 2 << "\n";
    for (int i = 0; i < n / 2; ++i) cout << "0 ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int test;
  cin >> test;
  while (test--) {
    solve();
  }
}
