#include <bits/stdc++.h>
using namespace std;
mt19937 rd(chrono ::steady_clock ::now().time_since_epoch().count());
long long Rand(long long l, long long h) { return l + rd() % (h - l + 1); }
template <typename T>
inline void read(T &x) {
  register char c;
  bool sign = 0;
  for (c = getchar(); !isdigit(c); c = getchar())
    if (c == '-') sign = !sign;
  x = c - '0';
  for (c = getchar(); isdigit(c); c = getchar()) x = x * 10 + c - '0';
  if (sign) x = -x;
}
template <typename T>
inline bool mini(T &x, T y) {
  if (x > y)
    x = y;
  else
    return 0;
  return 1;
}
template <typename T>
inline bool maxi(T &x, T y) {
  if (x < y)
    x = y;
  else
    return 0;
  return 1;
}
template <typename T>
inline void _abs(T &x) {
  if (x < 0) x = -x;
  return;
}
const int N = 1003;
int a[N];
int d[2];
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    d[0] = d[1] = 0;
    for (int i = 1; i <= n; ++i) d[a[i]]++;
    bool t;
    if (d[0] < d[1])
      t = 1;
    else
      t = 0;
    vector<int> res;
    for (int i = 1; i <= n; ++i)
      if (a[i] == t) res.push_back(t);
    if (t && (int)(res.size()) % 2) res.pop_back();
    cout << res.size() << '\n';
    for (int x : res) cout << x << " ";
    cout << '\n';
  }
  return 0;
}
