#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long M = (long long)1e9 + 7;
const long long inf = (long long)1e18;
const double pi = 2 * acos(0.0);
const double esp = 1e-9;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int ar[1005];
int main() {
  int test = 1;
  cin >> test;
  for (int cs = 1; cs <= test; ++cs) {
    int n, z = 0, o = 0;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> ar[i];
      if (ar[i] == 0)
        ++z;
      else
        ++o;
    }
    if (z >= n / 2) {
      cout << n / 2 << "\n";
      for (int i = 1; i <= n / 2; ++i) {
        cout << 0;
        if (i != n / 2) cout << " ";
      }
    } else {
      if ((n / 2) % 2) {
        cout << (n / 2) + 1 << "\n";
        for (int i = 1; i <= (n / 2) + 1; ++i) {
          cout << 1;
          if (i != (n / 2) + 1) cout << " ";
        }
      } else {
        cout << n / 2 << "\n";
        for (int i = 1; i <= n / 2; ++i) {
          cout << 1;
          if (i != n / 2) cout << " ";
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
