#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long INF = 1e18 + 20;
long long n, x, y, cnt;
long long a[1010];
void solve() {
  cnt = 0;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i]) cnt++;
  }
  if (cnt <= n / 2) {
    cout << n - cnt << endl;
    for (long long i = 1; i <= n; i++) {
      if (!a[i]) cout << a[i] << " ";
    }
  } else {
    if (cnt % 2) cnt--;
    cout << cnt << endl;
    for (long long i = 1; i <= n; i++) {
      if (a[i] && cnt--) cout << a[i] << " ";
    }
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
}
