#include <bits/stdc++.h>
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int i, j, a;
    int count1 = 0, count0 = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a);
      if (a == 1) {
        count1++;
      } else {
        count0++;
      }
    }
    if (count1 <= n / 2) {
      printf("%d\n", n - count1);
      for (j = 1; j <= n - count1; j++) {
        printf("0 ");
      }
    } else {
      if (count1 % 2 == 1) {
        count1--;
      }
      printf("%d\n", count1);
      for (j = 1; j <= count1; j++) {
        printf("%d ", 1);
      }
    }
    printf("\n");
  }
  return 0;
}
