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