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