#include <bits/stdc++.h>
using namespace std;
void solve() {
  int _;
  cin >> _;
  for (int ts = 0; ts < _; ++ts) {
    int n;
    cin >> n;
    int cnt[2] = {0, 0};
    for (int i = 0; i < n; ++i) {
      int tmp;
      cin >> tmp;
      cnt[tmp]++;
    }
    if (cnt[0] >= cnt[1]) {
      cout << cnt[0] << endl;
      for (int i = 0; i < cnt[0]; ++i) cout << 0 << " \n"[i == cnt[0] - 1];
    } else {
      if (cnt[1] & 1) cnt[1]--;
      cout << cnt[1] << endl;
      for (int i = 0; i < cnt[1]; ++i) cout << 1 << " \n"[i == cnt[1] - 1];
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
