#include <bits/stdc++.h>
using namespace std;
int main() {
  int ts;
  cin >> ts;
  while (ts--) {
    int n;
    cin >> n;
    vector<int> v(n);
    vector<int> pos[2];
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      pos[v[i]].push_back(i);
    }
    int x = 0;
    if (pos[0].size() >= n / 2) {
      x = 0;
    } else
      x = 1;
    if (x) {
      if (pos[x].size() % 2 != 0) {
        int k = pos[x].size() - 1;
        if (k < n / 2) {
          vector<int> vv;
          for (int i = 0; i < k; i++) vv.push_back(pos[x][i]);
          int f = lower_bound(pos[0].begin(), pos[0].end(), vv[vv.size() - 1]) -
                  pos[0].begin();
          int d =
              lower_bound(pos[0].begin(), pos[0].end(), vv[0]) - pos[0].begin();
          if (pos[0].size() - f >= 2) {
            vv.push_back(pos[0][f]);
            vv.push_back(pos[0][f + 1]);
            cout << vv.size() << "\n";
            for (int i = 0; i < vv.size(); i++) cout << v[vv[i]] << " ";
            cout << endl;
          } else if (d >= 1) {
            vv.push_back(pos[0][d]);
            vv.push_back(pos[0][d - 1]);
            cout << vv.size() << "\n";
            for (int i = vv.size() - 1; i >= 0; i--) {
              cout << v[vv[i]] << " ";
            }
            cout << endl;
          }
        } else {
          cout << k << "\n";
          for (int i = 0; i < k; i++) {
            cout << 1 << " ";
          }
          cout << "\n";
        }
      } else {
        cout << pos[x].size() << "\n";
        for (int i = 0; i < pos[x].size(); i++) cout << "1 ";
        cout << endl;
      }
    } else {
      cout << pos[x].size() << "\n";
      for (int i = 0; i < pos[x].size(); i++) cout << "0 ";
      cout << endl;
    }
  }
  return 0;
}
