#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int o = 0, z = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      if (a[i])
        o++;
      else
        z++;
    }
    if (o > z) {
      o -= (o & 1);
      cout << o << "\n";
      for (int i = 0; i < o; ++i) {
        cout << "1 ";
      }
      cout << "\n";
    } else {
      cout << z << "\n";
      for (int i = 0; i < z; ++i) {
        cout << "0 ";
      }
      cout << "\n";
    }
  }
  return 0;
}
