#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int c1 = 0, c0 = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1)
      c1++;
    else if (a[i] == 0)
      c0++;
  }
  if (c1 > n / 2) {
    if (c1 % 2 == 1) {
      c1--;
    }
    cout << c1 << endl;
    while (c1--) cout << 1 << ' ';
    cout << endl;
  } else {
    cout << c0 << endl;
    while (c0--) cout << 0 << ' ';
    cout << endl;
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
  cout << "Why are you reading this" << endl;
}
