#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int N = 1e6 + 10;
const int M = 3e5 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int mod3 = 1e9 + 9;
const int hash1 = 131;
const int hash2 = 13331;
const double eps = 1e-6;
int a[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int cnt0 = 0;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (!a[i]) cnt0++;
    }
    int cnt1 = n - cnt0;
    if (cnt1 <= n / 2) {
      cout << cnt0 << endl;
      for (int i = 1; i <= cnt0; i++) cout << "0 ";
      cout << endl;
    } else {
      cout << cnt1 - cnt1 % 2 << endl;
      for (int i = 1; i <= cnt1 - cnt1 % 2; i++) {
        cout << "1 ";
      }
      cout << endl;
    }
  }
  return 0;
}
