#include <bits/stdc++.h>
using namespace std;
long long pw(int a, int b) {
  int ret = 1;
  int mul = a;
  while (b > 0) {
    if (b & 1) ret *= mul;
    mul *= mul;
    b /= 2;
  }
  return ret;
}
int to_int(string s) {
  long long ret = 0;
  for (int i = 0; i < (s.size()); i++) {
    ret += pw(10, s.size() - i - 1) * (int)(s[i] - '0');
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    char s[n];
    for (int i = 0; i < (n); i++) cin >> s[i];
    int o = 0;
    for (int i = 0; i < (n); i++) o += (s[i] == '1');
    if (o <= n / 2) {
      cout << n / 2 << "\n";
      for (int i = 0; i < (n / 2); i++) cout << 0 << " ";
      cout << "\n";
    } else {
      if (n / 2 % 2 == 0) {
        cout << n / 2 << "\n";
        for (int i = 0; i < (n / 2); i++) cout << 1 << " ";
        cout << "\n";
      } else {
        cout << n / 2 + 1 << "\n";
        for (int i = 0; i < (n / 2 + 1); i++) cout << 1 << " ";
        cout << "\n";
      }
    }
  }
}
