#include <bits/stdc++.h>
using namespace std;
using ll = long long;
class AAhahahahahahahaha {
 public:
  void solve(std::istream& cin, std::ostream& cout) {
    int t;
    cin >> t;
    while (t--) {
      int n;
      cin >> n;
      int a[n], c0 = 0, c1 = 0;
      for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i])
          c1++;
        else
          c0++;
      }
      if (c1 <= n / 2) {
        cout << c0 << endl;
        for (int i = 0; i < c0; i++) cout << 0 << " ";
        cout << endl;
      } else {
        if (c1 % 2) c1--;
        cout << c1 << endl;
        for (int i = 0; i < c1; i++) cout << 1 << " ";
        cout << endl;
      }
    }
  }
};
int main() {
  AAhahahahahahahaha solver;
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
