#include <bits/stdc++.h>
using namespace std;
int n, m, k, h;
int s[100002], q[100002], r[100002];
int main() {
  while (cin >> n) {
    int t = 1;
    while (n--) {
      cin >> m;
      k = 0;
      h = 0;
      for (int i = 1; i <= m; ++i) {
        cin >> s[i];
        if (s[i]) k++;
        if (s[i] == 0) h++;
      }
      if (k <= m / 2) {
        cout << m - k << endl;
        for (int i = 1; i <= m; ++i)
          if (!s[i]) cout << s[i] << ' ';
      } else {
        cout << m - h - k % 2 << endl;
        k -= k % 2;
        for (int i = 1; i <= m; ++i)
          if (s[i] && k > 0) cout << s[i] << ' ', k--;
      }
      cout << endl;
    }
  }
}
