#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b ? gcd(b, a % b) : a); }
const long long MAX_PRIME = 1e9 + 7;
const long long INF = 1e18;
long long fast_pow(long long x, long long y, long long z) {
  if (y == 0)
    return 1 % z;
  else if (y == 1)
    return x % z;
  if (y % 2 == 0) {
    long long res = fast_pow(x, y / 2, z);
    return (res * res) % z;
  } else {
    long long res = fast_pow(x, y / 2, z);
    long long temp = (res * res) % z;
    return ((x % z) * temp) % z;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    long long count_0 = 0;
    long long count_1 = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0)
        count_0 += 1;
      else
        count_1 += 1;
    }
    if (count_0 >= count_1) {
      cout << count_0 << endl;
      for (long long i = 0; i < count_0; i++) {
        cout << "0 ";
      }
      cout << endl;
    } else {
      if (count_1 % 2 == 0) {
        cout << count_1 << endl;
        for (long long i = 0; i < count_1; i++) {
          cout << "1 ";
        }
        cout << endl;
      } else {
        cout << count_1 - 1 << endl;
        for (long long i = 0; i < count_1 - 1; i++) {
          cout << "1 ";
        }
        cout << endl;
      }
    }
  }
  return 0;
}
