#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const double pi = acos(-1);
inline int dcmp(double x) {
  if (x < -eps) return -1;
  if (x > eps) return 1;
  return 0;
}
int main() {
  int _;
  for (cin >> _; _; --_) {
    int n;
    cin >> n;
    int l = 0, r = 0;
    for (int i = 0; i < n; ++i) {
      int v;
      cin >> v;
      if (v == 0)
        ++l;
      else
        ++r;
    }
    int v = 0;
    if (l < r) v = 1;
    if (v == 0) {
      cout << l << endl;
      for (int i = 0; i < l; ++i) cout << 0 << ' ';
      cout << endl;
    } else if (v == 1) {
      int t = n / 2;
      if (t % 2 == 1) ++t;
      cout << t << endl;
      for (int i = 0; i < t; ++i) cout << 1 << ' ';
      cout << endl;
    }
  }
}
