#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, c1 = 0, c2 = 0, f;
    cin >> n;
    int a[n + 2];
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] == 1)
        c1++;
      else
        c2++;
    }
    if (c1 > c2) {
      if (c1 % 2) {
        cout << n - c2 - 1 << endl;
        c1 = 1;
      } else {
        cout << n - c2 << endl;
        c1 = 0;
      }
      for (int i = 1; i <= n; i++) {
        if (a[i] == 1 && c1 == 0) {
          cout << a[i] << " ";
        } else if (a[i] == 1)
          c1--;
      }
      cout << endl;
    } else if (c1 <= c2) {
      cout << n - c1 << endl;
      for (int i = 1; i <= n; i++) {
        if (a[i] == 0) {
          cout << a[i] << " ";
        }
      }
      cout << endl;
    }
  }
}
