#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int c1 = 0, c0 = 0;
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
      if (arr[i] == 1)
        c1++;
      else
        c0++;
    }
    if (c1 > c0) {
      if (c1 % 2 == 1) c1--;
      cout << c1 << endl;
      for (long long int i = 0; i < c1; i++) {
        cout << "1 ";
      }
    } else {
      cout << c0 << endl;
      for (long long int i = 0; i < c0; i++) cout << "0 ";
    }
    cout << endl;
  }
  return 0;
}
