#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int &x : v) {
      cin >> x;
    }
    int c = 0, u = 0;
    for (int i = 0; i < n; i++) {
      if (v[i] == 1) {
        u++;
      } else {
        c++;
      }
    }
    if (c >= n / 2) {
      cout << n / 2 << "\n";
      for (int i = 0; i < n / 2; i++) {
        cout << 0 << " ";
      }
      cout << "\n";
    } else {
      int mid = n / 2;
      if (mid % 2 == 0) {
        cout << n / 2 << "\n";
        for (int i = 0; i < n / 2; i++) {
          cout << 1 << " ";
        }
        cout << "\n";
      } else {
        cout << (n / 2) + 1 << "\n";
        for (int i = 0; i < (n / 2) + 1; i++) {
          cout << 1 << " ";
        }
        cout << "\n";
      }
    }
  }
  return 0;
}
