#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int a[n];
    int ones = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      ones += a[i] == 1;
    }
    if (ones <= n / 2) {
      cout << n - ones << endl;
      for (int i = 0; i < n; i++) {
        if (a[i] == 0) cout << a[i] << " ";
      }
    } else {
      cout << ones - (ones & 1) << endl;
      bool once = false;
      if (ones & 1) once = true;
      for (int i = 0; i < n; i++) {
        if (a[i] == 0) continue;
        if (once)
          once = false;
        else
          cout << a[i] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
