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