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