#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n], c0 = 0, c1 = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 1)
        c1++;
      else
        c0++;
    }
    if (c0 >= c1) {
      cout << c0 << "\n";
      for (int i = 0; i < c0; i++) {
        cout << 0 << " ";
      }
      cout << "\n";
    } else {
      if (c1 % 2) c1--;
      cout << c1 << "\n";
      for (int i = 0; i < c1; i++) {
        cout << 1 << " ";
      }
      cout << "\n";
    }
  }
}
