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