#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    cnt += x;
  }
  if (cnt * 2 <= n) {
    printf("%d\n", n / 2);
    for (int i = 1; i <= n / 2; i++) printf("0 ");
    printf("\n");
  } else {
    int x = n / 2;
    if (x & 1) x++;
    printf("%d\n", x);
    for (int i = 1; i <= x; i++) printf("1 ");
    printf("\n");
  }
  return;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
