#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int t;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> a(n + 1);
    long long int o = 0, z = 0;
    vector<long long int> ans;
    for (long long int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i])
        o++;
      else
        z++;
    }
    if (z >= n / 2) {
      for (long long int i = 1; i <= n; i++)
        if (!a[i]) ans.push_back(a[i]);
    } else {
      for (long long int i = 1; i <= n; i++)
        if (a[i]) ans.push_back(a[i]);
      if ((long long int)(ans.size()) % 2) ans.pop_back();
    }
    cout << ans.size() << "\n";
    for (auto x : ans) cout << x << " ";
    cout << "\n";
  }
}
