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