#include <bits/stdc++.h>
using namespace std;
void test_case() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  vector<int> amid;
  int s = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    s += a[i];
  }
  int z = n - s;
  if (z >= n / 2) {
    cout << n / 2 << '\n';
    for (int i = 0; i < n / 2; i++) cout << 0 << " ";
    puts("");
    return;
  }
  if (n % 4 == 0)
    n /= 2;
  else
    n = n / 2 + 1;
  cout << n << '\n';
  for (int i = 0; i < n; i++) cout << 1 << " ";
  puts("");
}
int main() {
  int t = 1;
  scanf("%d", &t);
  while (t--) test_case();
}
