#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
int n;
int a[maxn], num[2];
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    num[0] = num[1] = 0;
    for (int i = 1; i <= n; i++) cin >> a[i], num[a[i]]++;
    if (num[0] >= n / 2) {
      cout << n / 2 << '\n';
      for (int i = 1; i <= n / 2; i++) cout << "0 ";
      cout << '\n';
    } else {
      if ((n / 2) % 2 == 0) {
        cout << n / 2 << '\n';
        for (int i = 1; i <= n / 2; i++) cout << "1 ";
        cout << '\n';
      } else {
        cout << n / 2 + 1 << '\n';
        for (int i = 1; i <= n / 2 + 1; i++) cout << "1 ";
        cout << '\n';
      }
    }
  }
  return 0;
}
