//package CodeForces;

import java.io.*;
import java.util.*;

public class Main {

    public class Haha {
        /*                     _____                                                             ___
                /\      /\    |     | |   |    /\       /\      /\       /\      /\       /\    |   \     محمد أبوحسن*
               /  \    /  \   |     | |___|   /__\     /  \    /  \     /  \    /  \     /__\   |    \
              /    \  /    \  |     | |   |  /    \   /    \  /    \   /    \  /    \   /    \  |    /
             /      \/      \ |_____| |   | /      \ /      \/      \ /      \/      \ /      \ |___/
         */
    }

    public static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class MyPair {

        int x;
        int y;

        public MyPair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static int Fibonacci(int n) {
        int[] a = new int[n + 1];
        a[0] = 0;
        a[1] = 1;
        for (int i = 2; i < a.length; i++) {
            a[i] = a[i - 1] + a[i - 2];
        }
        return a[n];
    }

    public static boolean isprime(int n) {
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return true;
            }
        }
        return false;
    }

    public static int[] addarr(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        return a;
    }

    public static int fact(int n){
        int fact = 1;
        for(int i = 1; i <= n; i++)
            fact *= i;
        return fact;
    }

    public static long sumDigit(long n){
        int a = 0;
        while(n != 0){
            a += n%10;
            n /= 10;
        }
        return a;
    }

    public static long fastpow(long v,  long p){
        if (p == 0)  return 1;
        if (p == 1)  return v;
        long ans = fastpow(v, p / 2);
        if (p % 2 == 1)  return ans * ans * v;
        else  return ans * ans;
    }

    public static MyScanner sc = new MyScanner();
    public static int MOD = 1000000007;
    // __builtin_popcountll(n) <-- c++ // binary count(1) ex. 8 --> 0100 --> 1
    HashSet<Integer> set = new HashSet<>();
    HashMap<Integer, Integer> map = new HashMap<>();
    Random r = new Random();
    ArrayList<Integer> l = new ArrayList<>();

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            int[] a = new int[n];
            int sum1 = 0, sum0 = 0;
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
                if(a[i] == 0) sum0++;
                if(a[i] == 1) sum1++;
            }
            if(sum1%2 == 0){
                System.out.println(n);
                for (int i = 0; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println("");
                continue;
            }
            sum1--;
            Arrays.sort(a);
            if(sum1%2 == 0){n--;
                System.out.println(n);
                if(n != 0){
                    for (int i = 0; i < n; i++) {
                        System.out.print(a[i] + " ");
                    }
                    System.out.println("");
                }
                continue;
            }

            int k = n/2;
            System.out.println(k);
            boolean ok = true;
            boolean ok2 = true;
            for (int i = k; i < n; i++) {
                if(a[i] != 1)
                    ok = false;
            }
            for (int i = k; i < n; i++) {
                if(a[i] != 0)
                    ok2 = false;
            }
            if(ok || ok2){
                //System.out.println(ok + "    " + ok2);
                if(n%2 != 0)
                    System.out.print(0 + " ");
                for (int i = n%2 != 0 ? k+1 : k; i < (n%2 != 0 ? n-1 : n); i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println();
            }
            else{
                int r = 0;
                for (int i = 0; i < k/2; i++) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                for (int i = n-1; r < k; i--) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                System.out.println();
            }
        }
    }
}


//package CodeForces;

import java.io.*;
import java.util.*;

public class Main {

    public class Haha {
        /*                     _____                                                             ___
                /\      /\    |     | |   |    /\       /\      /\       /\      /\       /\    |   \     محمد أبوحسن*
               /  \    /  \   |     | |___|   /__\     /  \    /  \     /  \    /  \     /__\   |    \
              /    \  /    \  |     | |   |  /    \   /    \  /    \   /    \  /    \   /    \  |    /
             /      \/      \ |_____| |   | /      \ /      \/      \ /      \/      \ /      \ |___/
         */
    }

    public static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class MyPair {

        int x;
        int y;

        public MyPair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static int Fibonacci(int n) {
        int[] a = new int[n + 1];
        a[0] = 0;
        a[1] = 1;
        for (int i = 2; i < a.length; i++) {
            a[i] = a[i - 1] + a[i - 2];
        }
        return a[n];
    }

    public static boolean isprime(int n) {
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return true;
            }
        }
        return false;
    }

    public static int[] addarr(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        return a;
    }

    public static int fact(int n){
        int fact = 1;
        for(int i = 1; i <= n; i++)
            fact *= i;
        return fact;
    }

    public static long sumDigit(long n){
        int a = 0;
        while(n != 0){
            a += n%10;
            n /= 10;
        }
        return a;
    }

    public static long fastpow(long v,  long p){
        if (p == 0)  return 1;
        if (p == 1)  return v;
        long ans = fastpow(v, p / 2);
        if (p % 2 == 1)  return ans * ans * v;
        else  return ans * ans;
    }

    public static MyScanner sc = new MyScanner();
    public static int MOD = 1000000007;
    // __builtin_popcountll(n) <-- c++ // binary count(1) ex. 8 --> 0100 --> 1
    HashSet<Integer> set = new HashSet<>();
    HashMap<Integer, Integer> map = new HashMap<>();
    Random r = new Random();
    ArrayList<Integer> l = new ArrayList<>();

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            int[] a = new int[n];
            int sum1 = 0, sum0 = 0;
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
                if(a[i] == 0) sum0++;
                if(a[i] == 1) sum1++;
            }
            if(sum1%2 == 0){
                System.out.println(n);
                for (int i = 0; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println("");
                continue;
            }
            sum1--;
            Arrays.sort(a);
            if(sum1%2 == 0){n--;
                System.out.println(n);
                for (int i = 0; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println("");
                continue;
            }

            int k = n/2;
            System.out.println(k);
            boolean ok = true;
            boolean ok2 = true;
            for (int i = k; i < n; i++) {
                if(a[i] != 1)
                    ok = false;
            }
            for (int i = k; i < n; i++) {
                if(a[i] != 0)
                    ok2 = false;
            }
            if(ok || ok2){
                //System.out.println(ok + "    " + ok2);
                if(n%2 != 0)
                    System.out.print(0 + " ");
                for (int i = n%2 != 0 ? k+1 : k; i < (n%2 != 0 ? n-1 : n); i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println();
            }
            else{
                int r = 0;
                for (int i = 0; i < k/2; i++) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                for (int i = n-1; r < k; i--) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                System.out.println();
            }
        }
    }
}


//package CodeForces;

import java.io.*;
import java.util.*;

public class Main {

    public class Haha {
        /*                     _____                                                             ___
                /\      /\    |     | |   |    /\       /\      /\       /\      /\       /\    |   \     محمد أبوحسن*
               /  \    /  \   |     | |___|   /__\     /  \    /  \     /  \    /  \     /__\   |    \
              /    \  /    \  |     | |   |  /    \   /    \  /    \   /    \  /    \   /    \  |    /
             /      \/      \ |_____| |   | /      \ /      \/      \ /      \/      \ /      \ |___/
         */
    }

    public static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class MyPair {

        int x;
        int y;

        public MyPair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static int Fibonacci(int n) {
        int[] a = new int[n + 1];
        a[0] = 0;
        a[1] = 1;
        for (int i = 2; i < a.length; i++) {
            a[i] = a[i - 1] + a[i - 2];
        }
        return a[n];
    }

    public static boolean isprime(int n) {
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return true;
            }
        }
        return false;
    }

    public static int[] addarr(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        return a;
    }

    public static int fact(int n){
        int fact = 1;
        for(int i = 1; i <= n; i++)
            fact *= i;
        return fact;
    }

    public static long sumDigit(long n){
        int a = 0;
        while(n != 0){
            a += n%10;
            n /= 10;
        }
        return a;
    }

    public static long fastpow(long v,  long p){
        if (p == 0)  return 1;
        if (p == 1)  return v;
        long ans = fastpow(v, p / 2);
        if (p % 2 == 1)  return ans * ans * v;
        else  return ans * ans;
    }

    public static MyScanner sc = new MyScanner();
    public static int MOD = 1000000007;
    // __builtin_popcountll(n) <-- c++ // binary count(1) ex. 8 --> 0100 --> 1
    HashSet<Integer> set = new HashSet<>();
    HashMap<Integer, Integer> map = new HashMap<>();
    Random r = new Random();
    ArrayList<Integer> l = new ArrayList<>();

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            Arrays.sort(a);
            int k = n/2;
            System.out.println(k);
            if(n == 2){
                System.out.println("0");
                continue;
            }
            boolean ok = true;
            boolean ok2 = true;
            for (int i = k; i < n; i++) {
                if(a[i] != 1)
                    ok = false;
            }
            for (int i = k; i < n; i++) {
                if(a[i] != 0)
                    ok2 = false;
            }
            if(ok || ok2){
                if(k%2 != 0)
                    System.out.print(0 + " ");
                for (int i = k%2 != 0 ? k+1 : k; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println();
            }
            else{
                int r = 0;
                for (int i = 0; i < k/2; i++) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                for (int i = n-1; r < k; i--) {
                    System.out.print(a[i] + " ");
                    r++;
                }
                System.out.println();
            }
        }
    }
}


//package CodeForces;

import java.io.*;
import java.util.*;

public class Main {

    public class Haha {
        /*                     _____                                                             ___
                /\      /\    |     | |   |    /\       /\      /\       /\      /\       /\    |   \     محمد أبوحسن*
               /  \    /  \   |     | |___|   /__\     /  \    /  \     /  \    /  \     /__\   |    \
              /    \  /    \  |     | |   |  /    \   /    \  /    \   /    \  /    \   /    \  |    /
             /      \/      \ |_____| |   | /      \ /      \/      \ /      \/      \ /      \ |___/
         */
    }

    public static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class MyPair {

        int x;
        int y;

        public MyPair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static int Fibonacci(int n) {
        int[] a = new int[n + 1];
        a[0] = 0;
        a[1] = 1;
        for (int i = 2; i < a.length; i++) {
            a[i] = a[i - 1] + a[i - 2];
        }
        return a[n];
    }

    public static boolean isprime(int n) {
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return true;
            }
        }
        return false;
    }

    public static int[] addarr(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        return a;
    }

    public static int fact(int n){
        int fact = 1;
        for(int i = 1; i <= n; i++)
            fact *= i;
        return fact;
    }

    public static long sumDigit(long n){
        int a = 0;
        while(n != 0){
            a += n%10;
            n /= 10;
        }
        return a;
    }

    public static long fastpow(long v,  long p){
        if (p == 0)  return 1;
        if (p == 1)  return v;
        long ans = fastpow(v, p / 2);
        if (p % 2 == 1)  return ans * ans * v;
        else  return ans * ans;
    }

    public static MyScanner sc = new MyScanner();
    public static int MOD = 1000000007;
    // __builtin_popcountll(n) <-- c++ // binary count(1) ex. 8 --> 0100 --> 1
    HashSet<Integer> set = new HashSet<>();
    HashMap<Integer, Integer> map = new HashMap<>();
    Random r = new Random();
    ArrayList<Integer> l = new ArrayList<>();

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            int[] a = new int[n];
            int sum1 = 0, sum0 = 0;
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
                if(a[i] == 0) sum0++;
                if(a[i] == 1) sum1++;
            }
            if(sum1%2 == 0){
                System.out.println(n);
                for (int i = 0; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println("");
                continue;
            }
            sum1--;
            Arrays.sort(a);
            if(sum1%2 == 0){n--;
                System.out.println(n%2 != 0 ? n-1 : n);
                if(n != 0){
                    int i = 0;
                    if(n%2 != 0) i++;
                    //System.out.println(i + " " + n);
                    for (; i < n; i++) {
                        System.out.print(a[i] + " ");
                    }
                    System.out.println("");
                }
                continue;
            }
//
//            int k = n/2;
//            System.out.println(k);
//            boolean ok = true;
//            boolean ok2 = true;
//            for (int i = k; i < n; i++) {
//                if(a[i] != 1)
//                    ok = false;
//            }
//            for (int i = k; i < n; i++) {
//                if(a[i] != 0)
//                    ok2 = false;
//            }
//            if(ok || ok2){
//                //System.out.println(ok + "    " + ok2);
//                if(n%2 != 0)
//                    System.out.print(0 + " ");
//                for (int i = n%2 != 0 ? k+1 : k; i < (n%2 != 0 ? n-1 : n); i++) {
//                    System.out.print(a[i] + " ");
//                }
//                System.out.println();
//            }
//            else{
//                int r = 0;
//                for (int i = 0; i < k/2; i++) {
//                    System.out.print(a[i] + " ");
//                    r++;
//                }
//                for (int i = n-1; r < k; i--) {
//                    System.out.print(a[i] + " ");
//                    r++;
//                }
//                System.out.println();
//            }
        }
    }
}


//package CodeForces;

import java.io.*;
import java.util.*;

public class Main {

    public class Haha {
        /*                     _____                                                             ___
                /\      /\    |     | |   |    /\       /\      /\       /\      /\       /\    |   \     محمد أبوحسن*
               /  \    /  \   |     | |___|   /__\     /  \    /  \     /  \    /  \     /__\   |    \
              /    \  /    \  |     | |   |  /    \   /    \  /    \   /    \  /    \   /    \  |    /
             /      \/      \ |_____| |   | /      \ /      \/      \ /      \/      \ /      \ |___/
         */
    }

    public static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class MyPair {

        int x;
        int y;

        public MyPair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static int Fibonacci(int n) {
        int[] a = new int[n + 1];
        a[0] = 0;
        a[1] = 1;
        for (int i = 2; i < a.length; i++) {
            a[i] = a[i - 1] + a[i - 2];
        }
        return a[n];
    }

    public static boolean isprime(int n) {
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return true;
            }
        }
        return false;
    }

    public static int[] addarr(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        return a;
    }

    public static int fact(int n){
        int fact = 1;
        for(int i = 1; i <= n; i++)
            fact *= i;
        return fact;
    }

    public static long sumDigit(long n){
        int a = 0;
        while(n != 0){
            a += n%10;
            n /= 10;
        }
        return a;
    }

    public static long fastpow(long v,  long p){
        if (p == 0)  return 1;
        if (p == 1)  return v;
        long ans = fastpow(v, p / 2);
        if (p % 2 == 1)  return ans * ans * v;
        else  return ans * ans;
    }

    public static MyScanner sc = new MyScanner();
    public static int MOD = 1000000007;
    // __builtin_popcountll(n) <-- c++ // binary count(1) ex. 8 --> 0100 --> 1
    HashSet<Integer> set = new HashSet<>();
    HashMap<Integer, Integer> map = new HashMap<>();
    Random r = new Random();
    ArrayList<Integer> l = new ArrayList<>();

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            int[] a = new int[n];
            int sum1 = 0, sum0 = 0;
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
                if(a[i] == 0) sum0++;
                if(a[i] == 1) sum1++;
            }
            if(sum1%2 == 0){
                System.out.println(n);
                for (int i = 0; i < n; i++) {
                    System.out.print(a[i] + " ");
                }
                System.out.println("");
                continue;
            }
            sum1--;
            Arrays.sort(a);
            if(sum1%2 == 0){n--;
                System.out.println(n);
                if(n != 0){
                    int i = 0;
                    //if(n%2 != 0) i++;
                    //System.out.println(i + " " + n);
                    for (; i < n; i++) {
                        System.out.print(a[i] + " ");
                    }
                    System.out.println("");
                }
                continue;
            }
//
//            int k = n/2;
//            System.out.println(k);
//            boolean ok = true;
//            boolean ok2 = true;
//            for (int i = k; i < n; i++) {
//                if(a[i] != 1)
//                    ok = false;
//            }
//            for (int i = k; i < n; i++) {
//                if(a[i] != 0)
//                    ok2 = false;
//            }
//            if(ok || ok2){
//                //System.out.println(ok + "    " + ok2);
//                if(n%2 != 0)
//                    System.out.print(0 + " ");
//                for (int i = n%2 != 0 ? k+1 : k; i < (n%2 != 0 ? n-1 : n); i++) {
//                    System.out.print(a[i] + " ");
//                }
//                System.out.println();
//            }
//            else{
//                int r = 0;
//                for (int i = 0; i < k/2; i++) {
//                    System.out.print(a[i] + " ");
//                    r++;
//                }
//                for (int i = n-1; r < k; i--) {
//                    System.out.print(a[i] + " ");
//                    r++;
//                }
//                System.out.println();
//            }
        }
    }
}


import java.util.*;
public class adda
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            int zero=0,one=0;
            for(int i=0;i<n;i++)
            {
                int ai=sc.nextInt();
                if(ai==1)
                {
                one++;
               }
               else
               zero++;
            }
            if(one<=n/2)
            {
                System.out.println(n-one);
              for(int i=0;i<n-one;i++)
              System.out.print("0 ");
              System.out.println();
            }
            else if(zero<n/2)
            {
                if(one%2==0)
                {
                  System.out.println(n-zero);
                   for(int i=0;i<n-zero;i++)
                   System.out.print("1 ");
                   System.out.println();
                }
                else
                {
                 System.out.println(n-(zero+1));
                   for(int i=0;i<n-(zero+1);i++)
                   System.out.print("1 ");
                   System.out.println();
                }
            }
        }
    }
}


import java.util.*;
public class adda
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            int zero=0,one=0;
            for(int i=0;i<n;i++)
            {
                int ai=sc.nextInt();
                if(ai==1)
                {
                one++;
               }
               else
               zero++;
            }
            if(one<=n/2)
            {
                System.out.println(n-one);
              for(int i=1;i<n-one;i++)
              System.out.print("0 ");
              System.out.println();
            }
            else if(zero<n/2)
            {
                if(one%2==0)
                {
                  System.out.println(n-zero);
                   for(int i=0;i<n-zero;i++)
                   System.out.print("1 ");
                   System.out.println();
                }
                else
                {
                 System.out.println(n-(zero+1));
                   for(int i=0;i<n-(zero+1);i++)
                   System.out.print("1 ");
                   System.out.println();
                }
            }
        }
    }
}


import java.util.*;
public class adda
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            int zero=0,one=0;
            for(int i=0;i<n;i++)
            {
                int ai=sc.nextInt();
                if(ai==1)
                {
                one++;
               }
               else
               zero++;
            }
            if(one<=n/2)
            {
                System.out.println(n-one);
              for(int i=1;i<n-one;i++)
              System.out.print("0 ");
              System.out.println();
            }
            else if(zero<n/2)
            {
                if(one%2==0)
                {
                  System.out.println(n-zero);
                   for(int i=1;i<n-zero;i++)
                   System.out.print("1 ");
                   System.out.println();
                }
                else
                {
                 System.out.println(n-(zero+1));
                   for(int i=1;i<n-(zero+1);i++)
                   System.out.print("1 ");
                   System.out.println();
                }
            }
        }
    }
}


import java.util.*;
public class adda
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            ArrayList<Integer> ar=new ArrayList<>();
            int arr[]=new int[n];
            int o1=0,e1=0;
            for(int i=0;i<n;i++)
            {
                int ai=sc.nextInt();
                ar.add(ai);
                if(ai==1)
                {
                if(i%2==0)
                e1++;
                else
                o1++;
                arr[i]=1;
               }
            }
            if(e1>o1)
            {
                int diff=e1-o1,j=0;
                while(diff>0)
                {
                 if(arr[j]==1)
                 {
                     ar.remove(j);

                     diff--;
                    }
                    j+=2;
                }
            }
            else
            {
                int diff=o1-e1,j=1;
                while(diff>0)
                {
                 if(arr[j]==1)
                 {
                     ar.remove(j);

                     diff--;
                    }
                    j+=2;
                }
            }
            System.out.println(ar.size());
            for(int dd:ar)
            System.out.print(dd+" ");
            System.out.println();
        }
    }
}


import java.util.*;
public class adda
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            ArrayList<Integer> ar=new ArrayList<>();
            int arr[]=new int[n];
            int o1=0,e1=0;
            for(int i=0;i<n;i++)
            {
                int ai=sc.nextInt();
                ar.add(ai);
                if(ai==1)
                {
                if(i%2==0)
                e1++;
                else
                o1++;
                arr[i]=1;
               }
            }
            if(e1>o1)
            {
                int diff=e1-o1,j=0;
                while(diff>0)
                {
                 if(arr[j]==1)
                 {
                     ar.remove(j);

                     diff--;
                    }
                    j+=2;
                }
            }
            else if(o1>e1)
            {
                int diff=o1-e1,j=1;
                while(diff>0)
                {
                 if(arr[j]==1)
                 {
                     ar.remove(j);

                     diff--;
                    }
                    j+=2;
                }
            }
            System.out.println(ar.size());
            for(int dd:ar)
            System.out.print(dd+" ");
            System.out.println();
        }
    }
}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int ones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1) {
					ones++;
				}
			}
			int ind = 0;
			if(ones%2==0) {

				System.out.println(len);
				for(int a=0; a<len; a++) {
					if(a==0) {
						System.out.print(nums[a]);
					}
					else {
						System.out.print(" "+nums[a]);
					}

				}
				System.out.println();
			}

			else {
				System.out.println(len-1);
				StringBuilder sb = new StringBuilder();
				for(int o=0; o<len; o++) {
					if(nums[o]==1) {
						ind=o;
						break;
					}
				}
				for(int m=0; m<len; m++) {
					if(m==ind) {
						continue;
					}
					else {
						sb.append(" "+nums[m]);
					}
				}

				System.out.println(sb.toString().trim());
			}

		}
		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[2];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[conv(st.nextToken())]++;
			}
			int pri;
			if(nums[0]>=len/2) {
				pri=0;
			}
			else {
				pri=1;
			}
			int l = len/2;
			if(pri==1 && l%2==1) {
				l++;
			}
			System.out.println(l);
			for(int a=0; a<l; a++) {
				System.out.print(pri+" ");
			}
			System.out.println();
		}
		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int evenones = 0;
			int oddones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1 && z%2!=0) {
					oddones++;
				}
				else if(nums[z]==1 && z%2==0){
					evenones++;
				}
			}
			if(len==2) {
				if(nums[0]!=nums[1]) {
					System.out.println(1);
					System.out.println(min(nums[0],nums[1]));
				}
				else {
					System.out.println(2);
					System.out.println(nums[0]+" "+nums[1]);
				}
			}

			else {
				int diff = Math.abs(evenones-oddones);
				StringBuilder sb= new StringBuilder();
				int cnt = 0;
				if(evenones>oddones) {

					int v = len/2;
					for(int a=0; a<len-1; a++) {
						if(evenones>oddones) {
							if(nums[a]==1 && a%2==0) {
								evenones--;
								nums[a]=0;
								sb.append(" "+nums[a]);

								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());

				}
				else if(evenones<oddones) {
					int cnt1 = 0;
					int v = len/2;
					for(int a=1; a<len; a++) {
						if(oddones>evenones) {
							if(nums[a]==1 && a%2!=0) {
								nums[a]=0;
								sb.append(" "+nums[a]);
								oddones--;
								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());
				}
				else if(oddones==evenones) {
					for(int z=0;z<len; z++) {
						sb.append(" "+nums[z]);
					}
					System.out.println(len);
					System.out.println(sb.toString().trim());
				}
			}

			}

		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int evenones = 0;
			int oddones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1 && z%2!=0) {
					oddones++;
				}
				else if(nums[z]==1 && z%2==0){
					evenones++;
				}
			}
			if(len==2) {
				if(nums[0]!=nums[1]) {
					System.out.println(1);
					System.out.println(min(nums[0],nums[1]));
				}
				else {
					System.out.println(2);
					System.out.println(nums[0]+" "+nums[1]);
				}
			}

			else {
				int diff = Math.abs(evenones-oddones);
				StringBuilder sb= new StringBuilder();
				int cnt = 0;
				if(evenones>oddones) {

					int v = len/2;
					for(int a=0; a<len-1; a++) {
						if(evenones>=oddones) {
							if(nums[a]==1 && a%2==0) {
								evenones--;
								nums[a]=0;
								sb.append(" "+nums[a]);

								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff-1));
					System.out.println(sb.toString().trim());

				}
				else if(evenones<oddones) {
					int cnt1 = 0;
					int v = len/2;
					for(int a=1; a<len; a++) {
						if(oddones>=evenones) {
							if(nums[a]==1 && a%2!=0) {
								nums[a]=0;
								sb.append(" "+nums[a]);
								oddones--;
								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff-1));
					System.out.println(sb.toString().trim());
				}
				else if(oddones==evenones) {
					for(int z=0;z<len; z++) {
						sb.append(" "+nums[z]);
					}
					System.out.println(len);
					System.out.println(sb.toString().trim());
				}
			}

			}

		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int evenones = 0;
			int oddones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1 && z%2!=0) {
					oddones++;
				}
				else if(nums[z]==1 && z%2==0){
					evenones++;
				}
			}
			if(len==2) {
				if(nums[0]!=nums[1]) {
					System.out.println(1);
					System.out.println(min(nums[0],nums[1]));
				}
				else {
					System.out.println(2);
					System.out.println(nums[0]+" "+nums[1]);
				}
			}

			else {
				int diff = Math.abs(evenones-oddones);
				StringBuilder sb= new StringBuilder();
				int cnt = 0;
				if(evenones>oddones) {

					int v = len/2;
					for(int a=0; a<len-1; a++) {
						if(evenones>oddones) {
							if(nums[a]==1 && a%2==0 && nums[a+1]==0) {
								evenones--;
								cnt+=2;
								a++;
								continue;
							}
							else {
								sb.append(" "+nums[a]);
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-cnt));
					System.out.println(sb.toString().trim());

				}
				else if(evenones<oddones) {
					int cnt1 = 0;
					int v = len/2;
					for(int a=1; a<len; a++) {
						if(oddones>evenones) {
							if(nums[a-1]==0 && a%2!=0 && nums[a]==1) {
								cnt1+=2;
								oddones--;
								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-cnt1));
					System.out.println(sb.toString().trim());
				}
				else if(oddones==evenones) {
					for(int z=0;z<len; z++) {
						sb.append(" "+nums[z]);
					}
					System.out.println(len);
					System.out.println(sb.toString().trim());
				}
			}

			}

		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int evenones = 0;
			int oddones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1 && z%2!=0) {
					oddones++;
				}
				else if(nums[z]==1 && z%2==0){
					evenones++;
				}
			}
			if(len==2) {
				if(nums[0]!=nums[1]) {
					System.out.println(1);
					System.out.println(min(nums[0],nums[1]));
				}
				else {
					System.out.println(2);
					System.out.println(nums[0]+" "+nums[1]);
				}
			}

			else {
				int diff = Math.abs(evenones-oddones);
				StringBuilder sb= new StringBuilder();
				int cnt = 0;
				if(evenones>oddones) {

					int v = len/2;
					for(int a=0; a<len-1; a++) {
						if(evenones>=oddones) {
							if(nums[a]==1 && a%2==0) {
								evenones--;
								nums[a]=0;
								sb.append(" "+nums[a]);

								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());

				}
				else if(evenones<oddones) {
					int cnt1 = 0;
					int v = len/2;
					for(int a=1; a<len; a++) {
						if(oddones>=evenones) {
							if(nums[a]==1 && a%2!=0) {
								nums[a]=0;
								sb.append(" "+nums[a]);
								oddones--;
								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());
				}
				else if(oddones==evenones) {
					for(int z=0;z<len; z++) {
						sb.append(" "+nums[z]);
					}
					System.out.println(len);
					System.out.println(sb.toString().trim());
				}
			}

			}

		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int evenones = 0;
			int oddones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1 && z%2!=0) {
					oddones++;
				}
				else if(nums[z]==1 && z%2==0){
					evenones++;
				}
			}
			if(len==2) {
				if(nums[0]!=nums[1]) {
					System.out.println(1);
					System.out.println(min(nums[0],nums[1]));
				}
				else {
					System.out.println(2);
					System.out.println(nums[0]+" "+nums[1]);
				}
			}

			else {
				int diff = Math.abs(evenones-oddones);
				StringBuilder sb= new StringBuilder();

				if(evenones>oddones) {

					int v = len/2;
					for(int a=0; a<len-1; a++) {
						if(evenones>oddones) {
							if(nums[a]==1 && a%2==0 && nums[a+1]==0) {
								evenones--;
								a++;
								continue;
							}
							else {
								sb.append(" "+nums[a]);
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());

				}
				else if(evenones<oddones) {
					int v = len/2;
					for(int a=1; a<len; a++) {
						if(oddones>evenones) {
							if(nums[a-1]==0 && a%2!=0 && nums[a]==1) {
								oddones--;
								continue;
							}

						}
						else {
							sb.append(" "+nums[a]);
						}
					}
					System.out.println(Math.abs(len-diff));
					System.out.println(sb.toString().trim());
				}
				else if(oddones==evenones) {
					for(int z=0;z<len; z++) {
						sb.append(" "+nums[z]);
					}
					System.out.println(len);
					System.out.println(sb.toString().trim());
				}
			}

			}

		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[2];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[conv(st.nextToken())]++;
			}
			int pri;
			if(nums[0]>len/2) {
				pri=0;
			}
			else {
				pri=1;
			}
			int l = len/2;
			if(pri==1 && l%2==1) {
				l++;
			}
			System.out.println(l);
			for(int a=0; a<l; a++) {
				System.out.print(pri+" ");
			}
			System.out.println();
		in.close();
		out.close();
	}

}
}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[len];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[p]=conv(st.nextToken());
			}
			int ones = 0;
			for(int z=0; z<len; z++) {
				if(nums[z]==1) {
					ones++;
				}
			}
			int ind = 0;
			if(ones%2==0) {
				if(nums[0]==1 && nums[1]!=0 && len!=2) {
					System.out.println(len);
					for(int a=0; a<len; a++) {
						if(a==0) {
							System.out.print(nums[a]);
						}
						else {
							System.out.print(" "+nums[a]);
						}

					}
					System.out.println();
				}
				else {
					System.out.println(len-1);
					for(int a=0; a<len; a++) {
						if(a==1) {
							continue;
						}
						if(a==0) {
							System.out.print(nums[a]);
						}
						else {
							System.out.print(" "+nums[a]);
						}

					}
					System.out.println();
				}
			}

			else {
				System.out.println(len-1);
				StringBuilder sb = new StringBuilder();
				for(int o=0; o<len; o++) {
					if(nums[o]==1) {
						ind=o;
						break;
					}
				}
				for(int m=0; m<len; m++) {
					if(m==ind) {
						continue;
					}
					else {
						sb.append(" "+nums[m]);
					}
				}

				System.out.println(sb.toString().trim());
			}

		}
		in.close();
		out.close();
	}

}


/*
ID: grifync1
LANG: JAVA
PROG: codeforcesrd1
*/

//lil lil peezy
import java.util.*;
import java.io.*;

public class codeforcesrd1 {
	public static int conv(String s) {
		return Integer.parseInt(s);
	}

	public static int max(int a, int b) {
		return Math.max(a, b);
	}

	public static int min(int a, int b) {
		return Math.min(a, b);
	}

	public static void main(String[] args) throws IOException {
		//BufferedReader in = new BufferedReader(new FileReader("codeforcesrd1.in"));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("codeforcesrd1.out")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int cases = conv(in.readLine());
		for(int i=0; i<cases; i++) {
			int len = conv(in.readLine());
			int[] nums = new int[2];
			StringTokenizer st = new StringTokenizer(in.readLine());
			for(int p=0; p<len; p++) {
				nums[conv(st.nextToken())]++;
			}
			int pri;
			if(nums[0]>len/2) {
				pri=0;
			}
			else {
				pri=1;
			}
			if(pri==1 && (len/2)%2==1) {
				System.out.println(len/2);
			}
			for(int a=0; a<len/2; a++) {
				System.out.print(pri+" ");
			}
			System.out.println();
		in.close();
		out.close();
	}

}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class A{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int even = 0;
            	int odd = 0;
            	int one =0,zero = 0;
            	for(int i=0; i<n; i++) {
            		if(arr[i] == 1)
            			one++;
            		else
            			zero++;
            		if(i%2 == 0)
            			even+=arr[i];
            		else
            			odd+=arr[i];
            	}
            	if(even == odd) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}

            		if(n == 2) {
            			out.println(1);
                   		out.println("0");
                   		return;
            		}
            		int kk = n/2;
            		if((n/2)%2 != 0)
            			 kk = n/2 -1;
            		ArrayList<Integer> lis1 = new ArrayList<Integer>();
            		ArrayList<Integer> lis2 = new ArrayList<Integer>();
            		ArrayList<Integer> lis3 = new ArrayList<Integer>();
            		ArrayList<Integer> lis4 = new ArrayList<Integer>();
            		for(int e : arr) {
            			lis1.add(e);
            			lis2.add(e);
            			lis3.add(e);
            			lis4.add(e);
            		}
            		if(isvalid1(lis1,kk)) {
            			out.println(lis1.size());
            			for(int e : lis1)
            				out.print(e+" ");
            			out.println();
            		}
            		else if(isvalid2(lis2,kk)) {
            			out.println(lis2.size());
            			for(int e : lis2)
            				out.print(e+" ");
            			out.println();
            		}
            		else if(isvalid3(lis3, kk)) {
            			out.println(lis3.size());
            			for(int e : lis3)
            				out.print(e+" ");
            			out.println();
            		}
            		else {

            			isvalid4(lis4, kk);
            			out.println(lis4.size());
            			for(int e : lis4)
            				out.print(e+" ");
            			out.println();
            		}

            }

		private void isvalid4(ArrayList<Integer> lis1, int kk) {
			int i=lis1.size()-2;
			while(kk-- != 0) {
				lis1.remove(i--);

			}

		}

		private boolean isvalid3(ArrayList<Integer> lis1, int kk) {
			int i=lis1.size()-1;
			while(kk-- != 0) {
				lis1.remove(i);
				i-=2;
			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean isvalid2(ArrayList<Integer> lis1, int kk) {
			int i=1;
			while(kk-- != 0) {
				lis1.remove(i++);

			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean isvalid1(ArrayList<Integer> lis1, int kk) {
			int i=0;
			while(kk-- != 0) {
				lis1.remove(i++);

			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean check(ArrayList<Integer> lis1) {
			int even =0;
       	int  odd = 0;
       	for(int i=0; i<lis1.size(); i++) {

       		if(i%2 == 0)
       			even+=lis1.get(i);
       		else
       			odd+=lis1.get(i);
       	}
       	if(even == odd) {
       		return true;
       	}
			return false;
		}
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class A{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int even = 0;
            	int odd = 0;
            	int one =0,zero = 0;
            	for(int i=0; i<n; i++) {
            		if(arr[i] == 1)
            			one++;
            		else
            			zero++;
            		if(i%2 == 0)
            			even+=arr[i];
            		else
            			odd+=arr[i];
            	}
            	if(even == odd) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}
            	int temp1[] = new int[n/2];
            	int temp2[] = new int[n/2];
            	int j = 0,k = 0;
            	for(int i = 0; i<n; i++) {
            		if(i%2 == 0)
            			temp1[j++]=arr[i];
            		else
            			temp2[k++]=arr[i];
            	}
            	 even =0;
            	 odd = 0;
            	for(int i=0; i<n/2; i++) {

            		if(i%2 == 0)
            			even+=temp1[i];
            		else
            			odd+=temp1[i];
            	}
            	if(even == odd) {
            		out.println(n/2);
            		for(int e : temp1)
            			out.print(e+" ");
            		out.println();
            		return;
            	}

           		out.println(n/2);
           		for(int e : temp2)
           			out.print(e+" ");
           		out.println();

            }
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class A{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

    	public void solve(int testNumber, FastReader sc, PrintWriter out) {
        	int n = sc.nextInt();
        	int arr[] = sc.readArrayInt(n);
        	int even = 0;
        	int odd = 0;
        	int one =0,zero = 0;
        	for(int i=0; i<n; i++) {
        		if(arr[i] == 1)
        			one++;
        		else
        			zero++;
        		if(i%2 == 0)
        			even+=arr[i];
        		else
        			odd+=arr[i];
        	}
        	if(even == odd) {
        		out.println(n);
        		for(int e : arr)
        			out.print(e+" ");
        		out.println();
        		return;
        	}
        	if(one > zero) {
        		out.println(n/2 + (n/2)%2);
        		one = n/2+(n/2)%2;
        		while(one-- != 0) {
        			out.print("1 ");
        		}
        		out.println();
        	}
        	else {
        		out.println(n/2);
        		zero = n/2;
        		while(zero-- != 0) {
        			out.print("0 ");
        		}
        		out.println();
        	}
        }
    }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class A{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int even = 0;
            	int odd = 0;
            	int one =0,zero = 0;
            	for(int i=0; i<n; i++) {
            		if(arr[i] == 1)
            			one++;
            		else
            			zero++;
            		if(i%2 == 0)
            			even+=arr[i];
            		else
            			odd+=arr[i];
            	}
            	if(even == odd) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}
            	if(one > zero) {
            		out.println(n/2);
            		one = n/2;
            		while(one-- != 0) {
            			out.print("1 ");
            		}
            		out.println();
            	}
            	else {
            		out.println(n/2);
            		zero = n/2;
            		while(zero-- != 0) {
            			out.print("0 ");
            		}
            		out.println();
            	}
            }
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class B{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int oneeven = 0,oneodd = 0,zeroeven = 0,zeroodd =0;
            	int sumo = 0,sume = 0;
            	for(int i=0; i<n; i++) {
            		if(i%2 == 0) {
            			if(arr[i] == 1)
            				oneeven++;
            			else
            				zeroeven++;
            			sume+=arr[i];
            		}
            		else {
            			if(arr[i] == 1)
            				oneodd++;
            			else
            				zeroodd++;
            			sumo+=arr[i];
            		}
            	}
            	if(sume == sumo) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}
            	if((n/2)%2 == 0) {
            		int one  = oneeven+oneodd;
            		int zero = zeroeven+zeroodd;
            		if(one > zero) {
                		out.println(n/2);
                		one = n/2;
                		while(one-- != 0) {
                			out.print("1 ");
                		}
                		out.println();
                	}
                	else {
                		out.println(n/2);
                		zero = n/2;
                		while(zero-- != 0) {
                			out.print("0 ");
                		}
                		out.println();
                	}
            		return;
            	}
            	int diff = oneeven - oneodd;
            	if(diff < 0) {
            		out.println(n+diff);
            		for(int i=0; i<n; i++) {
            			if(i%2 == 0) {
            				if(arr[i] == 1 && diff<0)
            					diff++;
            				else
            					out.print(arr[i]+" ");
            			}
            			else {
            				out.print(arr[i]+" ");
            			}
            		}
            		out.println();
            	}
            	else {
            		out.println(n-diff);
            		for(int i=0; i<n; i++) {
            			if(i%2 == 0) {
            				if(arr[i] == 1 && diff>0)
            					diff--;
            				else
            					out.print(arr[i]+" ");
            			}
            			else {
            				out.print(arr[i]+" ");
            			}
            		}
            		out.println();
            	}

            }
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class B{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int oneeven = 0,oneodd = 0,zeroeven = 0,zeroodd =0;
            	int sumo = 0,sume = 0;
            	for(int i=0; i<n; i++) {
            		if(i%2 == 0) {
            			if(arr[i] == 1)
            				oneeven++;
            			else
            				zeroeven++;
            			sume+=arr[i];
            		}
            		else {
            			if(arr[i] == 1)
            				oneodd++;
            			else
            				zeroodd++;
            			sumo+=arr[i];
            		}
            	}
            	if(sume == sumo) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}
            	if((n/2)%2 == 0) {
            		int one  = oneeven+oneodd;
            		int zero = zeroeven+zeroodd;
            		if(one > zero) {
                		out.println(n/2);
                		one = n/2;
                		while(one-- != 0) {
                			out.print("1 ");
                		}
                		out.println();
                	}
                	else {
                		out.println(n/2);
                		zero = n/2;
                		while(zero-- != 0) {
                			out.print("0 ");
                		}
                		out.println();
                	}
            		return;
            	}
            	int diff = oneeven - oneodd;
            	if(diff < 0) {
            		out.println(n+diff);
            		oneodd+=diff;
            		while(oneeven-- != 0) {
            			out.print("1 1 ");
            		}
            		for(int i=0; i<zeroeven+zeroodd; i++) {
            			out.print("0 ");
            		}
            		out.println();
            	}
            	else {
            		out.println(n-diff);
            		oneeven-=diff;
            		while(oneeven-- != 0) {
            			out.print("1 1 ");
            		}
            		for(int i=0; i<zeroeven+zeroodd; i++) {
            			out.print("0 ");
            		}
            		out.println();
            	}

            }
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class A{

	public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = sc.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, sc, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader sc, PrintWriter out) {
            	int n = sc.nextInt();
            	int arr[] = sc.readArrayInt(n);
            	int even = 0;
            	int odd = 0;
            	int one =0,zero = 0;
            	for(int i=0; i<n; i++) {
            		if(arr[i] == 1)
            			one++;
            		else
            			zero++;
            		if(i%2 == 0)
            			even+=arr[i];
            		else
            			odd+=arr[i];
            	}
            	if(even == odd) {
            		out.println(n);
            		for(int e : arr)
            			out.print(e+" ");
            		out.println();
            		return;
            	}

            		if(n == 2) {
            			out.println(1);
                   		out.println("0");
                   		return;
            		}
            		int kk = n/2;
            		if((n/2)%2 != 0)
            			 kk = n/2 -1;
            		ArrayList<Integer> lis1 = new ArrayList<Integer>();
            		ArrayList<Integer> lis2 = new ArrayList<Integer>();
            		ArrayList<Integer> lis3 = new ArrayList<Integer>();
            		ArrayList<Integer> lis4 = new ArrayList<Integer>();
            		for(int e : arr) {
            			lis1.add(e);
            			lis2.add(e);
            			lis3.add(e);
            			lis4.add(e);
            		}
            		if(isvalid1(lis1,kk)) {
            			for(int e : lis1)
            				out.print(e+" ");
            			out.println();
            		}
            		else if(isvalid2(lis2,kk)) {
            			for(int e : lis2)
            				out.print(e+" ");
            			out.println();
            		}
            		else if(isvalid3(lis3, kk)) {
            			for(int e : lis3)
            				out.print(e+" ");
            			out.println();
            		}
            		else {
            			isvalid4(lis4, kk);
            			for(int e : lis4)
            				out.print(e+" ");
            			out.println();
            		}

            }

		private void isvalid4(ArrayList<Integer> lis1, int kk) {
			int i=lis1.size()-2;
			while(kk-- != 0) {
				lis1.remove(i--);

			}

		}

		private boolean isvalid3(ArrayList<Integer> lis1, int kk) {
			int i=lis1.size()-1;
			while(kk-- != 0) {
				lis1.remove(i);
				i-=2;
			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean isvalid2(ArrayList<Integer> lis1, int kk) {
			int i=1;
			while(kk-- != 0) {
				lis1.remove(i++);

			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean isvalid1(ArrayList<Integer> lis1, int kk) {
			int i=0;
			while(kk-- != 0) {
				lis1.remove(i++);

			}
			if(check(lis1))
				return true;
			return false;
		}

		private boolean check(ArrayList<Integer> lis1) {
			int even =0;
       	int  odd = 0;
       	for(int i=0; i<lis1.size(); i++) {

       		if(i%2 == 0)
       			even+=lis1.get(i);
       		else
       			odd+=lis1.get(i);
       	}
       	if(even == odd) {
       		return true;
       	}
			return false;
		}
        }

	static void shuffleSort(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffleSort(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        int[] readArrayInt(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
        long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i].equals("1"))
                    n1++;
                else
                    n0++;
            }
            String ans="";
            int c = n/2;
            if(n0>=c){
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    ans+="0 ";

            }
            else{
                int nn =c;
                if((c%2)!=0)
                    nn--;
                for(int i=1;i<=nn;i++)
                    ans+="1 ";
                    ans+="0";
            }
            System.out.println(c);
            System.out.println(ans.trim());
        }
    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i].equals("1"))
                    n1++;
                else
                    n0++;
            }
            String ans="";
            int c = n/2;
            if(n0>=c){
                for(int i=1;i<=c;i++)
                    ans+="0 ";

            }
            else{
                int nn =c;
                if((c%2)!=0)
                    nn--;
                for(int i=1;i<=nn;i++)
                    ans+="1 ";
                    ans+="0";
            }
            System.out.println(c);
            System.out.println(ans.trim());
        }
    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i].equals("1"))
                    n1++;
                else
                    n0++;
            }
            String ans="";
            if(n0>=(n/2)){
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    ans+="0 ";

            }
            else{
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    ans+="1 ";
            }
            System.out.println(ans.trim());
        }
    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i]=="1")
                    n1++;
                else
                    n0++;
            }
            if(n0>=(n/2)){
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    System.out.print(0);

            }
            else{
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    System.out.print(1);
            }
            System.out.println();
        }
    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i]=="1")
                    n1++;
                else
                    n0++;
            }
            String ans="";
            if(n0>=(n/2)){
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    ans+="0 ";

            }
            else{
                int c = n-(n/2);
                System.out.println(c);
                for(int i=1;i<=c;i++)
                    ans+="1 ";
            }
            System.out.println(ans.trim());
        }
    }

}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            sc.nextLine();
            String line = sc.nextLine();
            String num[] = line.split(" ");
            int n1=0,n0=0;
            for(int i=0;i<n;i++){
                if(num[i].equals("1"))
                    n1++;
                else
                    n0++;
            }
            String ans="";
            int c = n/2;
            if(n0>=c){
                for(int i=1;i<=c;i++)
                    ans+="0 ";

            }
            else{
                if(c%2!=0)
                    c++;
                for(int i=1;i<=c;i++)
                    ans+="1 ";
            }
            System.out.println(c);
            System.out.println(ans.trim());
        }
    }

}


import java.util.*;
public class Test {

	public static void zero() {
		System.out.println("0");
	}
	public static void one() {
		System.out.println("1 1");
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- != 0) {
			int n = sc.nextInt();
			int a[] = new int[n];
			for(int i = 0;i<n;i++) a[i] = sc.nextInt();

			int one = 0;
			int zero = 0;
			int flag = 5;
			int sum =0;
			for(int i = 0;i<n;i++) sum += a[i];

			if(n == 2 && sum == 0) {
				zero();
				break;
			}
			if(n == 2 && sum == 1) {
				zero();
				break;
			}
			if(n == 2 && sum == 2) {
				one();
				break;
			}

			if(a[0] == 1) {
				one++;
			}
			else zero++;

			for(int i = 1;i<n;i++) {
				if(a[i] == 1 && a[i-1] == 1) {
					one++;
				}
				else if(a[i] == 0 && a[i-1] == 0) zero++;
				if(one >= n/2) {
					flag = 1;
					break;
				}
				if(zero >= n/2) {
					flag = 0;
					break;
				}
			}

//
//
//				if(one >= n/2) {
//					flag = 1;
//					break;
//				}
//				if(zero >= n/2) {
//					flag = 0;
//					break;
//				}
//

//			int res[] = new int[n];
//			Arrays.fill(res, -1);
//			if(one == zero) {
//				for(int i = 0;i<one;i++)
//			}
			 if(flag == 1) {
				for(int i = 0;i<one;i++) {
					if(i != n-1)
					System.out.print("1 ");
					else System.out.print("1");
				}
			}
			else if(flag == 0) {
				for(int i = 0;i<zero;i++) {
					if(i != n-1) System.out.print("0 ");
					else System.out.print("0");
				}
			}
			System.out.println();
		}
	}

}


import java.util.*;
public class Test {

	public static void zero() {
		System.out.println("1");
		System.out.println("0");
	}
	public static void one() {
		System.out.println("2");
		System.out.println("1 1");
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- != 0) {
			int n = sc.nextInt();
			int a[] = new int[n];
			for(int i = 0;i<n;i++) a[i] = sc.nextInt();

			int one = 0;
			int zero = 0;
			int flag = 5;
			int sum =0;
			for(int i = 0;i<n;i++) sum += a[i];

			if(n == 2 && sum == 0) {
				zero();
				continue;
			}
			if(n == 2 && sum == 1) {
				zero();
				continue;
			}
			if(n == 2 && sum == 2) {
				one();
				continue;
			}

			if(a[0] == 1) {
				one++;
			}
			else zero++;

			for(int i = 1;i<n;i++) {
				if(a[i] == 1 && a[i-1] == 1) {
					one++;
				}
				else if(a[i] == 0 && a[i-1] == 0) zero++;
				if(one >= n/2) {
					flag = 1;
					break;
				}
				if(zero >= n/2) {
					flag = 0;
					break;
				}
				if(one + zero >= n/2) {
					flag = 2;
					break;
				}
			}

//
//
//				if(one >= n/2) {
//					flag = 1;
//					break;
//				}
//				if(zero >= n/2) {
//					flag = 0;
//					break;
//				}
//

//			int res[] = new int[n];
//			Arrays.fill(res, -1);
//			if(one == zero) {
//				for(int i = 0;i<one;i++)
//			}

			if(flag == 0) {
				System.out.println(zero);
				for(int i = 0;i<zero;i++) {
					if(i != n-1) System.out.print("0 ");
					else System.out.print("0");
				}
			}

			if(flag == 1) {
				System.out.println(one);
				for(int i = 0;i<one;i++) {
					if(i != n-1)
					System.out.print("1 ");
					else System.out.print("1");
				}
			}

			if(flag == 2) {
				System.out.println(one + zero);
				for(int i = 0;i<one;i++) {
					System.out.print("1 ");
				}
				for(int i = 0;i<zero;i++) {
					if(i != zero-1)
					System.out.print("0 ");
					else System.out.println("0");
				}

			}
			System.out.println();
		}
	}

}


import java.util.*;
public class Test {

	public static void zero() {
		System.out.println("0");
	}
	public static void one() {
		System.out.println("1 1");
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- != 0) {
			int n = sc.nextInt();
			int a[] = new int[n];
			for(int i = 0;i<n;i++) a[i] = sc.nextInt();

			int one = 0;
			int zero = 0;
			int flag = 5;
			int sum =0;
			for(int i = 0;i<n;i++) sum += a[i];

			if(n == 2 && sum == 0) {
				zero();
				continue;
			}
			if(n == 2 && sum == 1) {
				zero();
				continue;
			}
			if(n == 2 && sum == 2) {
				one();
				continue;
			}

			if(a[0] == 1) {
				one++;
			}
			else zero++;

			for(int i = 1;i<n;i++) {
				if(a[i] == 1 && a[i-1] == 1) {
					one++;
				}
				else if(a[i] == 0 && a[i-1] == 0) zero++;
				if(one >= n/2) {
					flag = 1;
					break;
				}
				if(zero >= n/2) {
					flag = 0;
					break;
				}
			}

//
//
//				if(one >= n/2) {
//					flag = 1;
//					break;
//				}
//				if(zero >= n/2) {
//					flag = 0;
//					break;
//				}
//

//			int res[] = new int[n];
//			Arrays.fill(res, -1);
//			if(one == zero) {
//				for(int i = 0;i<one;i++)
//			}
			 if(flag == 1) {
				for(int i = 0;i<one;i++) {
					if(i != n-1)
					System.out.print("1 ");
					else System.out.print("1");
				}
			}
			else if(flag == 0) {
				for(int i = 0;i<zero;i++) {
					if(i != n-1) System.out.print("0 ");
					else System.out.print("0");
				}
			}
			System.out.println();
		}
	}

}


import java.util.*;
public class Test {

	public static void zero() {
		System.out.println("1");
		System.out.println("0");
	}
	public static void one() {
		System.out.println("2");
		System.out.println("1 1");
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- != 0) {
			int n = sc.nextInt();
			int a[] = new int[n];
			for(int i = 0;i<n;i++) a[i] = sc.nextInt();

			ArrayList<Integer> al = new ArrayList<Integer>();

			int k = n/2;

			for(int i = 0;i<n;i += 4) {
				if(i + 4 <= n) {
					int fourSum = a[i] + a[i+1] + a[i+2] + a[i+3];
					if(fourSum >= 2) {
						al.add(1);
						al.add(1);
					}
					else {
						al.add(0);
						al.add(0);
					}
				}

				else {
					if(a[i] + a[i+1] == 2) {
						al.add(1);
						al.add(1);
					}
					else {
						if(a[i] + a[i+1] == 1) {
							al.add(0);
						}
						else {
							al.add(0);
							al.add(0);
						}
					}
				}

			}
			System.out.println(al.size());
			for(int i = 0;i<al.size();i++) {
				System.out.print(al.get(i) + " ");
			}
			System.out.println();
		}
	}

}