#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    long long one = 0;
    for (long long i = 0; i < n; i++) {
      if (a[i] == 1) one++;
    }
    int zero = n - one;
    if (one > n / 2) {
      if (one % 2 == 1 && one != 1) one--;
      cout << one << endl;
      for (int i = 1; i <= one; i++)
        cout << "1"
             << " ";
      cout << '\n';
    } else if (zero >= n / 2) {
      cout << zero << endl;
      for (int i = 1; i <= zero; i++)
        cout << "0"
             << " ";
      cout << '\n';
    }
  }
}
