#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int a[n], k = 0, i, s1 = 0, s2 = 0, o = 0, z = 0;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0)
        z++;
      else
        o++;
    }
    if (z >= o) {
      cout << z << endl;
      while (z--) cout << "0 ";
      cout << endl;
    } else {
      if (o & 1) {
        cout << o - 1 << endl;
        int y = o - 1;
        while (y--) cout << "1 ";
        cout << endl;
      } else {
        cout << o << endl;
        while (o--) cout << "1 ";
        cout << endl;
      }
    }
  }
  return 0;
}
