#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  long long c1 = 0, c0 = 0;
  for (long long i = 0, x; i < n; i++) {
    cin >> x;
    c0 += (x == 0);
    c1 += (x == 1);
  }
  if (c0 < c1) {
    if (c1 % 2 == 0) {
      cout << c1 << "\n";
      while (c1--) cout << "1 ";
    } else {
      cout << c1 - 1 << "\n";
      c1--;
      while (c1--) cout << "1 ";
    }
  } else {
    cout << c0 << "\n";
    while (c0--) cout << "0 ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
