#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a[10000], one = 0, zero = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 1)
        one++;
      else
        zero++;
    }
    if (one <= zero) {
      cout << zero << endl;
      for (int i = 0; i < zero; i++) cout << 0 << ' ';
    } else {
      one = (one / 2) * 2;
      cout << one << endl;
      for (int i = 0; i < one; i++) cout << 1 << ' ';
    }
    cout << endl;
  }
  return 0;
}
