#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
const int MOD = 1e9 + 7;
int A[maxn];
int main() {
  ios::sync_with_stdio(false);
  int T, n;
  cin >> T;
  while (T--) {
    cin >> n;
    int cnt0 = 0, cnt1 = 0;
    for (int i = 1, a; i <= n; i++) {
      cin >> a;
      if (a)
        cnt1++;
      else
        cnt0++;
    }
    int ans = n / 2;
    if (cnt1 > cnt0) {
      if (ans % 2 == 1) ans++;
      cout << ans << endl;
      for (int i = 1; i <= ans; i++) cout << "1 ";
      cout << endl;
    } else {
      cout << ans << endl;
      for (int i = 1; i <= ans; i++) cout << "0 ";
      cout << endl;
    }
  }
  return 0;
}
