#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int o = 0;
    int z = 0;
    for (int i = 0; i < n; i++) {
      int y;
      cin >> y;
      if (y == 1)
        o++;
      else
        z++;
    }
    if (z == o) {
      cout << n / 2 << "\n";
      for (int i = 1; i <= n / 2; i++) cout << "0 ";
    } else if (z > o) {
      cout << n / 2 << "\n";
      for (int i = 1; i <= n / 2; i++) cout << "0 ";
    } else {
      int y = n / 2;
      if (y % 2 == 0) {
        cout << y << "\n";
        for (int i = 0; i < y; i++) cout << "1 ";
      } else {
        cout << (y + 1) << "\n";
        for (int i = 0; i < y + 1; i++)
          cout << "1"
               << " ";
      }
    }
    cout << endl;
  }
}
