#include <bits/stdc++.h>
using namespace std;
void print(int n, int num) {
  cout << n << "\n";
  for (int i = 0; i < n; i++) {
    cout << num << " ";
  }
  cout << "\n";
}
int main() {
  long long int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    int cz = 0, co = 0;
    for (int i = 0; i < n; i++) {
      if (arr[i] == 0) {
        cz++;
      } else {
        co++;
      }
    }
    if (cz >= co) {
      print(n / 2, 0);
    } else {
      if (n % 4 == 0) {
        print(n / 2, 1);
      } else {
        print(n / 2 + 1, 1);
      }
    }
  }
}
