#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int t;
  scanf("%d", &t);
  int i;
  for (i = 0; i < t; i++) {
    int n;
    scanf("%d", &n);
    int arr[n];
    int zero = 0;
    int one = 0;
    int j;
    for (j = 0; j < n; j++) {
      scanf("%d", &arr[j]);
      if (arr[j] == 0) {
        zero++;
      } else {
        one++;
      }
    }
    if (zero >= n / 2) {
      printf("%d\n", n / 2);
      for (j = 1; j <= n / 2; j++) {
        printf("0 ");
      }
    } else if (zero == n) {
      printf("%d\n", n / 2);
      for (j = 1; j <= n / 2; j++) {
        printf("0 ");
      }
    } else if (one > n / 2) {
      if (one % 2 == 0) {
        printf("%d\n", one);
        for (j = 1; j <= one; j++) {
          printf("1 ");
        }
      } else {
        printf("%d\n", one - 1);
        for (j = 1; j < one; j++) {
          printf("1 ");
        }
      }
    }
    printf("\n");
  }
  return 0;
}
