#include <bits/stdc++.h>
using namespace std;
long long dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    long long c1 = 0, c0 = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0)
        c0++;
      else
        c1++;
    }
    if (c0 >= (n / 2)) {
      cout << n / 2;
      cout << "\n";
      ;
      for (long long i = 0; i < n / 2; i++) cout << 0 << " ";
      cout << "\n";
      ;
    } else {
      int num = n / 2;
      if (num % 2) num++;
      cout << num;
      cout << "\n";
      ;
      for (long long i = 0; i < num; i++) cout << 1 << " ";
      cout << "\n";
      ;
    }
  }
  return 0;
}
