#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, t, ones = 0, zeros = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    ones += t;
    zeros += 1 - t;
  }
  if (ones <= n / 2) {
    cout << zeros << endl;
    for (int i = 0; i < zeros; ++i) cout << 0 << " ";
    cout << endl;
  } else {
    cout << (ones & (1 ^ -1)) << endl;
    for (int i = 0; i < (ones & (1 ^ -1)); ++i) cout << 1 << " ";
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
