#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, i, b;
  cin >> t;
  while (t--) {
    cin >> a;
    int s = 0, z = 0;
    for (i = 0; i < a; i++) {
      cin >> b;
      if (b == 0) {
        z++;
      } else {
        s++;
      }
    }
    if (z < s) {
      cout << s - s % 2 << endl;
      for (int i = 0; i < s - s % 2; i++) {
        cout << 1 << " ";
      }
      cout << endl;
    } else {
      cout << a / 2 << endl;
      for (int i = 0; i < a / 2; i++) {
        cout << 0 << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
