#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    map<int, int> mp;
    for (long long int i = 0; i < n; i++) {
      mp[arr[i]]++;
    }
    if (mp[0] >= mp[1]) {
      cout << n / 2 << endl;
      for (long long int i = 0; i < n / 2; i++) {
        cout << 0 << " ";
      }
      cout << endl;
    } else {
      int z = n / 2;
      if (z % 2 != 0) {
        z++;
      }
      cout << z << endl;
      for (long long int i = 0; i < z; i++) {
        cout << 1 << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
