#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int dir[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int geshu1 = 0;
    int geshu0 = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      if (x)
        geshu1++;
      else
        geshu0++;
    }
    if (geshu0 >= n / 2) {
      cout << geshu0 << endl;
      for (int i = 0; i < geshu0; i++)
        if (i)
          cout << " " << 0;
        else
          cout << 0;
      cout << endl;
    } else {
      if (geshu1 & 1) geshu1--;
      cout << geshu1 << endl;
      for (int i = 0; i < geshu1; i++) {
        if (i)
          cout << " " << 1;
        else
          cout << 1;
      }
      cout << endl;
    }
  }
  return 0;
}
