#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T, N;
  int X, num1, num0;
  cin >> T;
  while (T--) {
    cin >> N;
    num1 = 0;
    num0 = 0;
    for (int i = 0; i < N; i++) {
      cin >> X;
      if (X == 1)
        num1++;
      else
        num0++;
    }
    int freq1 = 0, freq0 = 0;
    if (N == num1 && N % 2 == 0) {
      cout << num1 << "\n";
      for (int i = 0; i < N; i++) cout << 1 << " ";
      cout << "\n";
      continue;
    }
    if (num1 > num0) {
      if (num1 % 2 != 0) num1 -= 1;
      cout << num1 << "\n";
      for (int i = 0; i < num1; i++) cout << 1 << " ";
    } else if (num1 <= num0) {
      cout << num0 << "\n";
      for (int i = 0; i < num0; i++) cout << 0 << " ";
    }
    cout << "\n";
  }
  return 0;
}
