import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;

public class A
{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());
		while(t-->0)
		{
			int n = Integer.parseInt(br.readLine());
			int[] arr = new int[n];
			HashSet<Integer> removed = new HashSet<Integer>();
			String[] inp = br.readLine().split(" ");
			int even=0,odd=0;
			for(int i=0;i<n;i++)
				{
					int x =Integer.parseInt(inp[i]);
					arr[i]=x;
					if(x==1)
					{
						if((i&1)==0)even++;
						else odd++;
					}
				}
			if(odd!=even)
			{
			if((even+odd)%2==0)
			{
				odd=0;even=0;
				for(int i=0;i<n;i++)
				{
					if(arr[i]==0)
					{
						int tmpodd=0,tmpeven=0;
						for(int j=i+1;j<n;j++)
						{
							if(arr[j]==1)
							{
								if(j%2==0)tmpodd++;
								else tmpeven++;
							}
						}
						if(odd+tmpodd == even+tmpeven)
						{
							removed.add(i);
							break;
						}
					}
					else
					{
						if(i%2==0)even++;
						else odd++;
					}
				}
			}
			else
			{
				odd=0;even=0;
				for(int i=0;i<n;i++)
				{
					if(arr[i]==1)
					{
						int tmpodd=0,tmpeven=0;
						for(int j=i+1;j<n;j++)
						{
							if(arr[j]==1)
							{
								if(j%2==0)tmpodd++;
								else tmpeven++;
							}
						}
						if(odd+tmpodd == even+tmpeven)
						{
							removed.add(i);
							break;
						}
						else
						{
							if(i%2==0)even++;
							else odd++;
						}
					}
				}
			}
			}
			pw.println(n-removed.size());
			for(int i=0;i<n;i++)
			{
				if(!removed.contains(i))pw.print(arr[i]+" ");
			}
			pw.println();

		}
		pw.close();
		pw.flush();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;

public class A
{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());
		while(t-->0)
		{
			int n = Integer.parseInt(br.readLine());
			int[] arr = new int[n];
			HashSet<Integer> removed = new HashSet<Integer>();
			String[] inp = br.readLine().split(" ");
			int even=0,odd=0;
			for(int i=0;i<n;i++)
				{
					int x =Integer.parseInt(inp[i]);
					arr[i]=x;
					if(x==1)
					{
						if((i&1)==0)even++;
						else odd++;
					}
				}
			for(int i=0;i<n;i++)
			{
				if(odd==even)break;
				if(arr[i]==1)
				{
					removed.add(i);
					even=0;odd=0;
					int k=0;
					for(int j=0;j<n;j++) {
						if(!removed.contains(j)) {
						if(arr[j]==1)
						{
							if((k&1)==0)even++;
							else odd++;
						}
						k++;
						}
					}
				}

			}
			pw.println(n-removed.size());
			for(int i=0;i<n;i++)
			{
				if(!removed.contains(i))pw.print(arr[i]+" ");
			}
			pw.println();

		}
		pw.close();
		pw.flush();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;

public class A
{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());
		while(t-->0)
		{
			int n = Integer.parseInt(br.readLine());
			int[] arr = new int[n];
			HashSet<Integer> removed = new HashSet<Integer>();
			String[] inp = br.readLine().split(" ");
			int even=0,odd=0;
			for(int i=0;i<n;i++)
				{
					int x =Integer.parseInt(inp[i]);
					arr[i]=x;
					if(x==1)
					{
						if((i&1)==0)even++;
						else odd++;
					}
				}
			for(int i=0;i<n;i++)
			{
				if(odd==even)break;
				if(arr[i]==1)
				{
					removed.add(i);
					even=0;odd=0;
					for(int j=0;j<n;j++) {
						if(!removed.contains(i)) {
						if(arr[j]==1)
						{
							if((j&1)==0)even++;
							else odd++;
						}
						}
					}
				}

			}
			pw.println(n-removed.size());
			for(int i=0;i<n;i++)
			{
				if(!removed.contains(i))pw.print(arr[i]+" ");
			}
			pw.println();

		}
		pw.close();
		pw.flush();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.LinkedList;

public class A
{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());
		while(t-->0)
		{
			int n = Integer.parseInt(br.readLine());
			int[] arr = new int[n];
			HashSet<Integer> removed = new HashSet<Integer>();
			String[] inp = br.readLine().split(" ");
			int even=0,odd=0;
			for(int i=0;i<n;i++)
				{
					int x =Integer.parseInt(inp[i]);
					arr[i]=x;
					if(x==1)
					{
						if((i&1)==0)even++;
						else odd++;
					}
				}
			boolean oddindex=true;
			for(int i=0;i<n;i++)
			{
				if(odd==even)break;
				if(arr[i]==1)
				{
					if((i&1) == (removed.size()&1))even--;
					else odd--;
					int tmp=odd;
					odd=even;
					even=tmp;
					removed.add(i);
				}
			}
			pw.println(n-removed.size());
			for(int i=0;i<n;i++)
			{
				if(!removed.contains(i))pw.print(arr[i]+" ");
			}
			pw.println();

		}
		pw.close();
		pw.flush();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;

public class A
{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());
		while(t-->0)
		{
			int n = Integer.parseInt(br.readLine());
			int[] arr = new int[n];
			HashSet<Integer> removed = new HashSet<Integer>();
			String[] inp = br.readLine().split(" ");
			int even=0,odd=0;
			for(int i=0;i<n;i++)
				{
					int x =Integer.parseInt(inp[i]);
					arr[i]=x;
					if(x==1)
					{
						if((i&1)==0)even++;
						else odd++;
					}
				}
			int c=Math.abs(odd-even);
			for(int i=0;i<n;i++)
			{
				if(c==0)break;
				if(arr[i]==1)
				{
					c--;
					removed.add(i);
				}
			}
			pw.println(n-removed.size());
			for(int i=0;i<n;i++)
			{
				if(!removed.contains(i))pw.print(arr[i]+" ");
			}
			pw.println();

		}
		pw.close();
		pw.flush();
	}

}


import java.util.*;
import java.io.*;
/**
 *
 * @author alanl
 */
public class Main{
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), arr[] = new int[n], cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                arr[i] = readInt();
                if(arr[i]==1)cnt++;
                else cnt1++;
            }
            if(cnt<n/2){
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                System.out.println();
            }
            else if(cnt%2==0){
                System.out.println(cnt);
                for(int i = 0; i<cnt; i++)System.out.print(1+" ");
            }
            else{
                if(cnt-1<n/2){
                    System.out.println(cnt1);
                    for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                    System.out.println();
                    continue;
                }
                System.out.println(cnt-1);
                for(int i = 0; i<cnt-1; i++)System.out.print(1+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
    static void print(Object b) {
        System.out.print(b);
    }
    static void println(Object b) {
        System.out.println(b);
    }
    static void println() {
        System.out.println();
    }
    /* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
    // Did you read the bounds?
    // Did you make typos?
    // Are there edge cases (N=1?)
    // Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
    // Integer overflow?
    // DS reset properly between test cases?
    // Is using long longs causing TLE?
    // Are you using floating points?
    */
}


import java.util.*;
import java.io.*;
import java.math.*;
/**
 *
 * @author alanl
 */
public class Code {

    /**
     * @param args the command line arguments
     */
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                int a = readInt();
                if(a%2==0)cnt++;
                else cnt1++;
            }
            if(cnt>=cnt1 && cnt%2==0){
                System.out.println(cnt);
                for(int i = 0; i<cnt; i++)System.out.print(1+" ");
            }
            else{
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
}


import java.util.*;
import java.io.*;
/**
 *
 * @author alanl
 */
public class Main{
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), arr[] = new int[n], cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                arr[i] = readInt();
                if(arr[i]==1)cnt++;
                else cnt1++;
            }
            if(cnt<n/2){
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                System.out.println();
            }
            else if(cnt%2==0){
                System.out.println(n);
                for(int i = 0; i<n; i++)System.out.print(arr[i]+" ");
            }
            else{
                if(cnt-1<n/2){
                    System.out.println(cnt1);
                    for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                    System.out.println();
                    continue;
                }
                System.out.println(cnt-1);
                for(int i = 0; i<cnt-1; i++)System.out.print(1+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
    static void print(Object b) {
        System.out.print(b);
    }
    static void println(Object b) {
        System.out.println(b);
    }
    static void println() {
        System.out.println();
    }
    /* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
    // Did you read the bounds?
    // Did you make typos?
    // Are there edge cases (N=1?)
    // Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
    // Integer overflow?
    // DS reset properly between test cases?
    // Is using long longs causing TLE?
    // Are you using floating points?
    */
}


import java.util.*;
import java.io.*;
import java.math.*;
/**
 *
 * @author alanl
 */
public class main {

    /**
     * @param args the command line arguments
     */
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                int a = readInt();
                if(a%2==0)cnt++;
                else cnt1++;
            }
            if(cnt>=cnt1){
                System.out.println(cnt);
                for(int i = 0; i<cnt; i++)System.out.print(1+" ");
            }
            else{
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
}


import java.util.*;
import java.io.*;
/**
 *
 * @author alanl
 */
public class Main{
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), arr[] = new int[n], cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                arr[i] = readInt();
                if(arr[i]==1)cnt++;
                else cnt1++;
            }
            if(cnt<n/2){
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                System.out.println();
            }
            else if(cnt%2==0){
                System.out.println(cnt);
                for(int i = 0; i<cnt; i++)System.out.print(arr[i]+" ");
            }
            else{
                if(cnt-1<n/2){
                    System.out.println(cnt1);
                    for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
                    System.out.println();
                    continue;
                }
                System.out.println(cnt-1);
                for(int i = 0; i<cnt-1; i++)System.out.print(1+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
    static void print(Object b) {
        System.out.print(b);
    }
    static void println(Object b) {
        System.out.println(b);
    }
    static void println() {
        System.out.println();
    }
    /* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
    // Did you read the bounds?
    // Did you make typos?
    // Are there edge cases (N=1?)
    // Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
    // Integer overflow?
    // DS reset properly between test cases?
    // Is using long longs causing TLE?
    // Are you using floating points?
    */
}


import java.util.*;
import java.io.*;
import java.math.*;
/**
 *
 * @author alanl
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int t = readInt();
        while(t-->0){
            int n = readInt(), cnt = 0, cnt1 = 0;
            for(int i = 0; i<n; i++){
                int a = readInt();
                if(a==1)cnt++;
                else cnt1++;
            }
            if(cnt>cnt1){
                System.out.println(cnt);
                for(int i = 0; i<cnt; i++)System.out.print(1+" ");
            }
            else{
                System.out.println(cnt1);
                for(int i = 0; i<cnt1; i++)System.out.print(0+" ");
            }
            System.out.println();
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
}


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		int sumEven =0;
		int sumOdd = 0;
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
			if(i%2==0) {
				sumEven+=arr[i];
			}
			else {
				sumOdd+=arr[i];
			}
		}
		if(n==2) {
			System.out.println(1);
			System.out.print(0);
		}
		else if(sumEven==sumOdd) {
			System.out.println(arr.length);
			for (int i = 0; i < arr.length; i++) {
				System.out.print(arr[i] + " ");
			}
		}
		else {
			int diff = Math.abs(sumEven-sumOdd);
			ArrayList<Integer> result = new ArrayList<Integer>();
			for (int i = 1; i < arr.length; i+=2) {
				if(Math.abs(arr[i]-arr[i-1])==0) {
					result.add(arr[i-1]);
					result.add(arr[i]);
				}
			}
			System.out.println(result.size());
			for (int i = 0; i < result.size(); i++) {
				System.out.print(result.get(i) + " ");
			}
		}
		System.out.println();
	}
	}
}


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		ArrayList<Integer> even = new ArrayList<Integer>();
		ArrayList<Integer> odd = new ArrayList<Integer>();
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
			if(i%2==0) {
				even.add(arr[i]);
			}
			else {
				odd.add(arr[i]);
			}

		}
		if(arr.length==2) {
			if(arr[0]-arr[1]==0) {
				System.out.println(2);
				System.out.println(arr[0] + " " + arr[1]);
			}
			else if(Math.abs(arr[0]-arr[1])==1){
				System.out.println(1);
				System.out.println(0);
			}
			else{
				System.out.println(1);
				System.out.println(0);
			}
		}
		else {
			ArrayList<Integer> result = new ArrayList<Integer>();
			for (int i = 0; i < Math.min(even.size(),odd.size()); i++) {
				if(even.get(i)==odd.get(i)) {
					result.add(even.get(i));
					result.add(odd.get(i));

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


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		ArrayList<Integer> result = new ArrayList<Integer>();
		ArrayList<Integer> even = new ArrayList<Integer>();
		ArrayList<Integer> odd = new ArrayList<Integer>();
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
			if(i%2==0) {
				even.add(arr[i]);
			}
			else {
				odd.add(arr[i]);
			}
			result.add(arr[i]);

		}
		if(arr.length==2) {
			if(arr[0]-arr[1]==0) {
				System.out.println(2);
				System.out.println(arr[0] + " " + arr[1]);
			}
			else if(Math.abs(arr[0]-arr[1])==1){
				System.out.println(1);
				System.out.println(0);
			}
			else{
				System.out.println(1);
				System.out.println(0);
			}
		}
		else {
			Collections.sort(even);
			Collections.sort(odd);
			ArrayList<Integer> rem = new ArrayList<Integer>();
			for (int i = 0; i < Math.min(even.size(),odd.size()); i++) {
				if(even.get(i)!=odd.get(i)) {
					rem.add(even.get(i));
					rem.add(odd.get(i));

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


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		ArrayList<Integer> result = new ArrayList<Integer>();
		ArrayList<Integer> even = new ArrayList<Integer>();
		ArrayList<Integer> odd = new ArrayList<Integer>();
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
			if(i%2==0) {
				even.add(arr[i]);
			}
			else {
				odd.add(arr[i]);
			}
			result.add(arr[i]);

		}
			Collections.sort(even);
			Collections.sort(odd);
			ArrayList<Integer> rem = new ArrayList<Integer>();
			for (int i = 0; i < Math.min(even.size(),odd.size()); i++) {
				if(even.get(i)!=odd.get(i)) {
					rem.add(even.get(i));
					rem.add(odd.get(i));

			}
			}
			for (int i = 0; i < rem.size(); i++) {
				result.remove(rem.get(i));
			}
			if(result.size()==0) {
				System.out.println(1);
				System.out.println(0);
			}
			else {
			System.out.println(result.size());
			for (int i = 0; i < result.size(); i++) {
				System.out.print(result.get(i) + " ");
			}
			System.out.println();
			}
	}
	}
}


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		int one=0,zero=0;
		for(int i=0;i<n;i++){
			arr[i] = sc.nextInt();
			if(arr[i]==0){
				zero++;
			}else{
				one++;
			}
		}
		if(zero>=one  || one ==1){
			System.out.println(0);;
			for(int i=0;i<zero;i++){
				System.out.print(0 + " ");
			}
			System.out.println();
		}else{
			if(one%2==1){
				one--;
			}
			System.out.println(one);
			for(int i=0;i<one;i++){
				System.out.print(1 + " ");
			}
			System.out.println();
			}
	}
	}
}


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		int sumEven =0;
		int sumOdd = 0;
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
			if(i%2==0) {
				sumEven+=arr[i];
			}
			else {
				sumOdd+=arr[i];
			}
		}
		if(n==2) {
			System.out.println(1);
			System.out.println(0);
		}
		else {
		ArrayList<Integer> result = new ArrayList<Integer>();
		for (int i = 0; i < arr.length-1; i+=2) {
			if(Math.abs(arr[i]-arr[i+1])==0){
				result.add(arr[i]);
				result.add(arr[i+1]);
			}
		}
		System.out.println(result.size());
		for (int i = 0; i < result.size(); i++) {
			System.out.print(result.get(i) + " ");
		}
		System.out.println();
	}
	}
	}
}


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextInt();
		}
		if(arr.length==2) {
			if(arr[0]-arr[1]==0) {
				System.out.println(2);
				System.out.println(arr[0] + " " + arr[1]);
			}
			else if(Math.abs(arr[0]-arr[1])==1){
				System.out.println(1);
				System.out.println(0);
			}
			else{
				System.out.println(1);
				System.out.println(0);
			}
		}
		else {
			if(arr.length%2==1) {
				ArrayList<Integer> result =new ArrayList<Integer>();
				for (int j = 1; j < arr.length; j+=2) {
					if(arr[j]==arr[j-1]) {
						result.add(arr[j-1]);
						result.add(arr[j]);
					}

				}
				System.out.println(result.size());
				for (int j2 = 0; j2 < result.size(); j2++) {
					System.out.print(result.get(j2) + " ");
				}
				System.out.println();
			}
			else {
				ArrayList<Integer> result =new ArrayList<Integer>();
				for (int j = 1; j < arr.length; j+=2) {
					if(arr[j]==arr[j-1]) {
						result.add(arr[j-1]);
						result.add(arr[j]);
					}

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


import java.util.*;

public class Round669A {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int test = sc.nextInt();
	while(test-->0) {
		int n = sc.nextInt();
		int arr[] = new int[n];
		int one=0,zero=0;
		for(int i=0;i<n;i++){
			arr[i] = sc.nextInt();
			if(arr[i]==0){
				zero++;
			}else{
				one++;
			}
		}
		if(zero>=one  || one ==1){
			System.out.println(zero);;
			for(int i=0;i<zero;i++){
				System.out.print(0 + " ");
			}
			System.out.println();
		}else{
			if(one%2==1){
				one--;
			}
			System.out.println(one);
			for(int i=0;i<one;i++){
				System.out.print(1 + " ");
			}
			System.out.println();
			}
	}
	}
}


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

public class _1407A {
    static int[] MODS = {1000000007, 998244353};
    static int MOD = MODS[0];

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
            }
            int count0 = 0;
            for (int i = 0; i < n; i++) {
                if (arr[i] == 0) {
                    count0++;
                }
            }
            if (count0 * 2 >= n) {
                out.println(count0);
                for (int i = 0; i < count0; i++) {
                    out.print(0+" ");
                }
                out.println();
            }
            else {
                if ((n - count0 % 2) == 0) {
                    out.println(n - count0);
                    for (int i = 0; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
                else {
                    out.println(n - count0 - 1);
                    for (int i = 1; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
            }
        }
        out.close();
    }

    public static PrintWriter out;

    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;
        }
    }
}


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

public class _1407A {
    static int[] MODS = {1000000007, 998244353};
    static int MOD = MODS[0];

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
            }
            int count0 = 0;
            for (int i = 0; i < n; i++) {
                if (arr[i] == 0) {
                    count0++;
                }
            }
            if (count0 * 2 >= n) {
                out.println(count0);
                for (int i = 0; i < count0; i++) {
                    out.print(0+" ");
                }
                out.println();
            }
            else {
                if ((n - count0) % 2 == 0) {
                    out.println(n - count0);
                    for (int i = 0; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
                else {
                    out.println(n - count0 - 1);
                    for (int i = 1; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
            }
        }
        out.close();
    }

    public static PrintWriter out;

    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;
        }
    }
}


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

public class _1407A {
    static int[] MODS = {1000000007, 998244353};
    static int MOD = MODS[0];

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
            }
            int count0 = 0;
            for (int i = 0; i < n; i++) {
                if (arr[i] == 0) {
                    count0++;
                }
            }
            if (count0 * 2 >= n) {
                out.println(count0);
                for (int i = 0; i < count0; i++) {
                    out.print(0+" ");
                }
                out.println();
            }
            else {
                if (n - count0 % 2 == 0) {
                    out.println(n - count0);
                    for (int i = 0; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
                else {
                    out.println(n - count0 - 1);
                    for (int i = 1; i < n - count0; i++) {
                        out.print(1+" ");
                    }
                    out.println();
                }
            }
        }
        out.close();
    }

    public static PrintWriter out;

    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;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
public final class codeForces
{
    public static void main(String args[])
    {
        StringBuilder ans=new StringBuilder();;
        FastReader in=new FastReader();
        int T=in.nextInt();
        while(T-->0)
        {
            int N=in.nextInt();
            int A[]=new int[N];
            boolean check[]=new boolean[N];
            int zero=0,one=0;
            int sum=0;
            boolean f=false;
            for(int i=0; i<N; i++)
            {
                A[i]=in.nextInt();
                if(A[i]==1)one++;
                else zero++;
                if(f)
                {
                    sum+=A[i]-A[i-1];
                    f=false;
                }
                else
                {
                    f=true;
                }
            }
            if(sum==0)
            {
                //simply print A
                System.out.println(N);
                for(int i=0; i<N; i++)
                {
                    System.out.print(A[i]+" ");
                }
                System.out.println();
            }
            else if(zero>=N/2)
            {
                //print N/2 zero
                System.out.println(N/2);
                for(int i=0; i<N/2; i++)System.out.println(0+" ");
                System.out.println();
            }
            else
            {
                //N/2 is even or (N/2)-1 is even
                //check for position of zero

                //System.out.println(N/2);
                if(N%4==0)
                {
                    //print all 1
                    System.out.println(N/2);
                    for(int i=0; i<N/2; i++)System.out.print(1+" " );
                    System.out.println();

                }
                else
                {
                    //print N/2-1 1 and 1 zero
                   System.out.println((N/2)+1);
                   for(int i=0; i<=N/2; i++)System.out.print(1);
                   System.out.println();

                }

            }

        }
        //System.out.println(ans);
    }
    //fucntions
    //fucntions
    //fucntions
    //fucntions
    static int[] input(int A[]) //input of Int Array
    {
        FastReader in=new FastReader();
        int N=A.length;
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] input(long A[]) //Input of long Array
    {
        FastReader in=new FastReader();
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static int GCD(int a,int b) //wrong output if a ||b are intially zero
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

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

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        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;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
public final class codeForces
{
    public static void main(String args[])
    {
        StringBuilder ans=new StringBuilder();;
        FastReader in=new FastReader();
        int T=in.nextInt();
        while(T-->0)
        {
            int N=in.nextInt();
            int A[]=new int[N];
            boolean check[]=new boolean[N];
            int zero=0,one=0;
            int sum=0;
            for(int i=0; i<N; i++)
            {
                A[i]=in.nextInt();
                if(A[i]==1)one++;
                else zero++;
                if(A[i]%2!=0)sum+=A[i-1]-A[i];
            }
            if(sum==0)
            {
                //simply print A
                System.out.println(N);
                for(int i=0; i<N; i++)
                {
                    System.out.print(A[i]);
                }
                System.out.println();
            }
            else if(zero>=N/2)
            {
                //print N/2 zero
                System.out.println(N/2);
                for(int i=0; i<N/2; i++)System.out.println(0);
                System.out.println();
            }
            else
            {
                //N/2 is even or (N/2)-1 is even
                //check for position of zero

                System.out.println(N/2);
                if(N%4==0)
                {
                    //print all 1
                    System.out.println(N/2);
                    for(int i=0; i<N/2; i++)System.out.print(1);
                    System.out.println();

                }
                else
                {
                    //print N/2-1 1 and 1 zero
                   System.out.println((N/2)+1);
                   for(int i=0; i<=N/2; i++)System.out.print(1);
                   System.out.println();

                }

            }

        }
        System.out.println(ans);
    }
    //fucntions
    //fucntions
    //fucntions
    //fucntions
    static int[] input(int A[]) //input of Int Array
    {
        FastReader in=new FastReader();
        int N=A.length;
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] input(long A[]) //Input of long Array
    {
        FastReader in=new FastReader();
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static int GCD(int a,int b) //wrong output if a ||b are intially zero
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

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

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        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;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
public final class codeForces
{
    public static void main(String args[])
    {
        StringBuilder ans=new StringBuilder();;
        FastReader in=new FastReader();
        int T=in.nextInt();
        while(T-->0)
        {
            int N=in.nextInt();
            int A[]=new int[N];
            boolean check[]=new boolean[N];
            int zero=0,one=0;
            int sum=0;
            boolean f=false;
            for(int i=0; i<N; i++)
            {
                A[i]=in.nextInt();
                if(A[i]==1)one++;
                else zero++;
                if(f)
                {
                    sum+=A[i]-A[i-1];
                    f=false;
                }
                else
                {
                    f=true;
                }
            }
            if(sum==0)
            {
                //simply print A
                System.out.println(N);
                for(int i=0; i<N; i++)
                {
                    System.out.print(A[i]);
                }
                System.out.println();
            }
            else if(zero>=N/2)
            {
                //print N/2 zero
                System.out.println(N/2);
                for(int i=0; i<N/2; i++)System.out.println(0);
                System.out.println();
            }
            else
            {
                //N/2 is even or (N/2)-1 is even
                //check for position of zero

                //System.out.println(N/2);
                if(N%4==0)
                {
                    //print all 1
                    System.out.println(N/2);
                    for(int i=0; i<N/2; i++)System.out.print(1);
                    System.out.println();

                }
                else
                {
                    //print N/2-1 1 and 1 zero
                   System.out.println((N/2)+1);
                   for(int i=0; i<=N/2; i++)System.out.print(1);
                   System.out.println();

                }

            }

        }
        //System.out.println(ans);
    }
    //fucntions
    //fucntions
    //fucntions
    //fucntions
    static int[] input(int A[]) //input of Int Array
    {
        FastReader in=new FastReader();
        int N=A.length;
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] input(long A[]) //Input of long Array
    {
        FastReader in=new FastReader();
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static int GCD(int a,int b) //wrong output if a ||b are intially zero
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

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

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        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;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
public final class codeForces
{
    public static void main(String args[])
    {
        StringBuilder ans=new StringBuilder();;
        FastReader in=new FastReader();
        int T=in.nextInt();
        while(T-->0)
        {
            int N=in.nextInt();
            int A[]=new int[N];
            boolean check[]=new boolean[N];
            int zero=0,one=0;
            int sum=0;
            boolean f=false;
            for(int i=0; i<N; i++)
            {
                A[i]=in.nextInt();
                if(A[i]==1)one++;
                else zero++;
                if(f)
                {
                    sum+=A[i]-A[i-1];
                    f=false;
                }
                else
                {
                    f=true;
                }
            }
            if(sum==0)
            {
                //simply print A
                System.out.println(N);
                for(int i=0; i<N; i++)
                {
                    System.out.print(A[i]);
                }
                System.out.println();
            }
            else if(zero>=N/2)
            {
                //print N/2 zero
                System.out.println(N/2);
                for(int i=0; i<N/2; i++)System.out.println(0);
                System.out.println();
            }
            else
            {
                //N/2 is even or (N/2)-1 is even
                //check for position of zero

                System.out.println(N/2);
                if(N%4==0)
                {
                    //print all 1
                    System.out.println(N/2);
                    for(int i=0; i<N/2; i++)System.out.print(1);
                    System.out.println();

                }
                else
                {
                    //print N/2-1 1 and 1 zero
                   System.out.println((N/2)+1);
                   for(int i=0; i<=N/2; i++)System.out.print(1);
                   System.out.println();

                }

            }

        }
        System.out.println(ans);
    }
    //fucntions
    //fucntions
    //fucntions
    //fucntions
    static int[] input(int A[]) //input of Int Array
    {
        FastReader in=new FastReader();
        int N=A.length;
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] input(long A[]) //Input of long Array
    {
        FastReader in=new FastReader();
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static int GCD(int a,int b) //wrong output if a ||b are intially zero
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

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

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        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;
    }

}


import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
public final class codeForces
{
    public static void main(String args[])
    {
        StringBuilder ans=new StringBuilder();;
        FastReader in=new FastReader();
        int T=in.nextInt();
        while(T-->0)
        {
            int N=in.nextInt();
            int A[]=new int[N];
            boolean check[]=new boolean[N];
            int zero=0,one=0;
            int sum=0;
            boolean f=false;
            for(int i=0; i<N; i++)
            {
                A[i]=in.nextInt();
                if(A[i]==1)one++;
                else zero++;
            }
            if(zero>=N/2)
            {
                System.out.println(N/2);
                for(int i=0; i<N/2; i++)System.out.print(0+" ");
                System.out.println();
            }
            else
            {
                if(N%4==0)
                {
                    System.out.println(N/2);
                    for(int i=0; i<N/2; i++)
                    System.out.print(1+" ");
                    System.out.println();
                }
                else
                {
                    System.out.println((N/2)+1);
                    for(int i=0; i<N/2; i++)
                    System.out.print(1+" ");
                    System.out.print(1+" ");
                    System.out.println();
                }
            }

        }
        //System.out.println(ans);
    }
    //fucntions
    //fucntions
    //fucntions
    //fucntions
    static int[] input(int A[]) //input of Int Array
    {
        FastReader in=new FastReader();
        int N=A.length;
        for(int i=0; i<N; i++)
        {
            A[i]=in.nextInt();
        }
        return A;
    }

    static long[] input(long A[]) //Input of long Array
    {
        FastReader in=new FastReader();
        for(int i=0; i<A.length; i++)A[i]=in.nextLong();
        return A;
    }

    static int GCD(int a,int b) //wrong output if a ||b are intially zero
    {
        if(b==0)
        {
            return a;
        }
        else return GCD(b,a%b );
    }

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

}
//Code For FastReader
//Code For FastReader
//Code For FastReader
//Code For FastReader
class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    public FastReader()
    {
        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;
    }

}


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

 public class gfg  {

    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int t = Reader.nextInt();
        while(t-->0){
            solve();
        }
        out.close();
    }
    static int n =0,m=0;
    static long mod =1000000007;
    static int MOD = 1000000007;
    static int[] dx = {0,0,1,-1};
    static int[] dy = {1,-1,0,0};
    //static int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};
    static ArrayList<Integer>[] graph;
    static int first=0,dist=0,max=0;
    static int[] dep;
    static HashSet<Integer> set = new HashSet<>();

    static void solve() throws IOException{
        int n = Reader.nextInt();
        int[] arr = new int[n];
        int one=0;
        for(int i=0;i<n;i++){
            arr[i] =Reader.nextInt();
            if(arr[i]==1)
                one++;
        }
        if(one>(n/2)){
            if(n%4==0){
                out.println(n/2);
                for(int i=0;i<n/2;i++)
                    out.print(1+" ");
            }
            else{
                out.println(n/2 +1 );
                for(int i=0;i<n/2+1;i++)
                    out.print(1+" ");
            }

        }
        else{
            out.println(n/2);
            for(int i=0;i<n/2;i++)
                out.print(0+" ");
        }
        out.println();
    }

    // ggratest common divisor println
    static int gcd(int a , int b){
        if(b==0)
            return a;
        else
            return gcd(b,a%b);
    }

    // least common multiple
    static int lcm(int a, int b){
        return (a*b)/gcd(a,b);
    }

    // a^b
    static long fastpow(long a, long b){
        long res = 1;a=a%mod;
        while(b>0){
            if(b%2==1)
                res = (res*a)%mod;
            a = (a*a)%mod;
            b = b>>1;
        }
        return res;
    }

    // segment tree
   /* static void update(int ind, int l, int h, int pos, int v){
        if(l==h){
            seg[ind] = v;
            return;
        }
        int mid = (l+h)/2;
        if(pos<=mid)
            update(2*ind,l,mid,pos,v);
        else
            update(2*ind+1,mid+1,h,pos,v);
        seg[ind] = seg[2*ind]^seg[2*ind+1];
    }
    static int query(int ind, int l , int h, int ll , int hh){
        if(ll>hh)
            return 0;
        if(l==ll && h==hh)
            return seg[ind];
        int mid = (l+h)/2;
        return query(2*ind,l,mid,ll,Math.min(mid,hh)) ^ query(2*ind+1,mid+1,h,Math.max(mid+1,ll),hh);
    }*/
    // priority queue with comparator
    // PriorityQueue<Interval> pq = new PriorityQueue<>(new Comparator<Interval>() {
    //             public int compare(Interval a, Interval b){
    //                 int diff1 = a.r - a.l;
    //                 int diff2 = b.r - b.l;

    //                 if(diff1 == diff2){
    //                     return a.l - b.l;
    //                 }

    //                 return diff2 - diff1;
    //             }
    // });
}

class trienode{
        int v;
        trienode[] child ;
        boolean leaf;
        int cnt;
        int p=0;
        trienode(int vv){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=vv;
        }
        trienode(){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=0;
        }
    }
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class newcomparator implements Comparator<Integer>{
    //@Override
    public int compare(Integer a, Integer  b){
        return a<=b?1:-1;
    }
 }
class node {
    int f;
    int s;// cost to rreach\
    node(int ff,int ss){
        f=ff;
        s=ss;
    }
}
class mergesort{
    static void sort(int l, int h, int[] arr){
        if(l<h){
            int mid = (l+h)/2;

            sort(l,mid,arr);
            sort(mid+1,h,arr);
            merge(l,mid,h,arr);
        }
    }
    static void merge(int l, int m , int h , int [] arr){

        int[] left = new int[m-l+1];
        int[] right = new int[h-m];
        for(int i= 0 ;i< m-l+1;i++){
            left[i] = arr[l+i];
        }
        for(int i=0;i<h-m;i++){
            right[i] = arr[m+1+i];
        }
        //now left and right arrays are assumed to be sorted and we have tp merge them together
        // int the original aaray.
        int i=l;
        int lindex = 0;
        int rindex =  0;

        while(lindex<m-l+1 && rindex<h-m){
            if(left[lindex]<=right[rindex]){
                arr[i]=left[lindex];
                lindex++;
                i++;
            }
            else{
                arr[i]=right[rindex];
                rindex++;
                i++;
            }
        }
        while(lindex<m-l+1){
            arr[i]=left[lindex];
            lindex++;
            i++;
        }
        while(rindex<h-m){
            arr[i]=right[rindex];
            rindex++;
            i++;
        }
    }

}


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

 public class gfg  {

    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int t = Reader.nextInt();
        while(t-->0){
            solve();
        }
        out.close();
    }
    static int n =0,m=0;
    static long mod =1000000007;
    static int MOD = 1000000007;
    static int[] dx = {0,0,1,-1};
    static int[] dy = {1,-1,0,0};
    //static int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};
    static ArrayList<Integer>[] graph;
    static int first=0,dist=0,max=0;
    static int[] dep;
    static HashSet<Integer> set = new HashSet<>();

    static void solve() throws IOException{
        int n = Reader.nextInt();
        int[] arr = new int[n];
        int one=0;
        for(int i=0;i<n;i++){
            arr[i] =Reader.nextInt();
            if(arr[i]==1)
                one++;
        }
        if(one>=(n/2)){
            int c = 0;
            if((n-one)%2==1)
                c = n-one-1;
            else
                c = n-one;
            out.println(c);
            for(int i=0;i<c;i++)
                out.print(1+" ");
        }
        else{
            out.println(n-one);
            for(int i=0;i<n;i++)
                out.print(0+" ");
        }
        out.println();
    }

    // ggratest common divisor println
    static int gcd(int a , int b){
        if(b==0)
            return a;
        else
            return gcd(b,a%b);
    }

    // least common multiple
    static int lcm(int a, int b){
        return (a*b)/gcd(a,b);
    }

    // a^b
    static long fastpow(long a, long b){
        long res = 1;a=a%mod;
        while(b>0){
            if(b%2==1)
                res = (res*a)%mod;
            a = (a*a)%mod;
            b = b>>1;
        }
        return res;
    }

    // segment tree
   /* static void update(int ind, int l, int h, int pos, int v){
        if(l==h){
            seg[ind] = v;
            return;
        }
        int mid = (l+h)/2;
        if(pos<=mid)
            update(2*ind,l,mid,pos,v);
        else
            update(2*ind+1,mid+1,h,pos,v);
        seg[ind] = seg[2*ind]^seg[2*ind+1];
    }
    static int query(int ind, int l , int h, int ll , int hh){
        if(ll>hh)
            return 0;
        if(l==ll && h==hh)
            return seg[ind];
        int mid = (l+h)/2;
        return query(2*ind,l,mid,ll,Math.min(mid,hh)) ^ query(2*ind+1,mid+1,h,Math.max(mid+1,ll),hh);
    }*/
    // priority queue with comparator
    // PriorityQueue<Interval> pq = new PriorityQueue<>(new Comparator<Interval>() {
    //             public int compare(Interval a, Interval b){
    //                 int diff1 = a.r - a.l;
    //                 int diff2 = b.r - b.l;

    //                 if(diff1 == diff2){
    //                     return a.l - b.l;
    //                 }

    //                 return diff2 - diff1;
    //             }
    // });
}

class trienode{
        int v;
        trienode[] child ;
        boolean leaf;
        int cnt;
        int p=0;
        trienode(int vv){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=vv;
        }
        trienode(){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=0;
        }
    }
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class newcomparator implements Comparator<Integer>{
    //@Override
    public int compare(Integer a, Integer  b){
        return a<=b?1:-1;
    }
 }
class node {
    int f;
    int s;// cost to rreach\
    node(int ff,int ss){
        f=ff;
        s=ss;
    }
}
class mergesort{
    static void sort(int l, int h, int[] arr){
        if(l<h){
            int mid = (l+h)/2;

            sort(l,mid,arr);
            sort(mid+1,h,arr);
            merge(l,mid,h,arr);
        }
    }
    static void merge(int l, int m , int h , int [] arr){

        int[] left = new int[m-l+1];
        int[] right = new int[h-m];
        for(int i= 0 ;i< m-l+1;i++){
            left[i] = arr[l+i];
        }
        for(int i=0;i<h-m;i++){
            right[i] = arr[m+1+i];
        }
        //now left and right arrays are assumed to be sorted and we have tp merge them together
        // int the original aaray.
        int i=l;
        int lindex = 0;
        int rindex =  0;

        while(lindex<m-l+1 && rindex<h-m){
            if(left[lindex]<=right[rindex]){
                arr[i]=left[lindex];
                lindex++;
                i++;
            }
            else{
                arr[i]=right[rindex];
                rindex++;
                i++;
            }
        }
        while(lindex<m-l+1){
            arr[i]=left[lindex];
            lindex++;
            i++;
        }
        while(rindex<h-m){
            arr[i]=right[rindex];
            rindex++;
            i++;
        }
    }

}


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

 public class gfg  {

    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int t = Reader.nextInt();
        while(t-->0){
            solve();
        }
        out.close();
    }
    static int n =0,m=0;
    static long mod =1000000007;
    static int MOD = 1000000007;
    static int[] dx = {0,0,1,-1};
    static int[] dy = {1,-1,0,0};
    //static int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};
    static ArrayList<Integer>[] graph;
    static int first=0,dist=0,max=0;
    static int[] dep;
    static HashSet<Integer> set = new HashSet<>();

    static void solve() throws IOException{
        int n = Reader.nextInt();
        int[] arr = new int[n];
        int one=0;
        for(int i=0;i<n;i++){
            arr[i] =Reader.nextInt();
            if(arr[i]==1)
                one++;
        }
        if(one>(n/2)){

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

    // ggratest common divisor println
    static int gcd(int a , int b){
        if(b==0)
            return a;
        else
            return gcd(b,a%b);
    }

    // least common multiple
    static int lcm(int a, int b){
        return (a*b)/gcd(a,b);
    }

    // a^b
    static long fastpow(long a, long b){
        long res = 1;a=a%mod;
        while(b>0){
            if(b%2==1)
                res = (res*a)%mod;
            a = (a*a)%mod;
            b = b>>1;
        }
        return res;
    }

    // segment tree
   /* static void update(int ind, int l, int h, int pos, int v){
        if(l==h){
            seg[ind] = v;
            return;
        }
        int mid = (l+h)/2;
        if(pos<=mid)
            update(2*ind,l,mid,pos,v);
        else
            update(2*ind+1,mid+1,h,pos,v);
        seg[ind] = seg[2*ind]^seg[2*ind+1];
    }
    static int query(int ind, int l , int h, int ll , int hh){
        if(ll>hh)
            return 0;
        if(l==ll && h==hh)
            return seg[ind];
        int mid = (l+h)/2;
        return query(2*ind,l,mid,ll,Math.min(mid,hh)) ^ query(2*ind+1,mid+1,h,Math.max(mid+1,ll),hh);
    }*/
    // priority queue with comparator
    // PriorityQueue<Interval> pq = new PriorityQueue<>(new Comparator<Interval>() {
    //             public int compare(Interval a, Interval b){
    //                 int diff1 = a.r - a.l;
    //                 int diff2 = b.r - b.l;

    //                 if(diff1 == diff2){
    //                     return a.l - b.l;
    //                 }

    //                 return diff2 - diff1;
    //             }
    // });
}

class trienode{
        int v;
        trienode[] child ;
        boolean leaf;
        int cnt;
        int p=0;
        trienode(int vv){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=vv;
        }
        trienode(){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=0;
        }
    }
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class newcomparator implements Comparator<Integer>{
    //@Override
    public int compare(Integer a, Integer  b){
        return a<=b?1:-1;
    }
 }
class node {
    int f;
    int s;// cost to rreach\
    node(int ff,int ss){
        f=ff;
        s=ss;
    }
}
class mergesort{
    static void sort(int l, int h, int[] arr){
        if(l<h){
            int mid = (l+h)/2;

            sort(l,mid,arr);
            sort(mid+1,h,arr);
            merge(l,mid,h,arr);
        }
    }
    static void merge(int l, int m , int h , int [] arr){

        int[] left = new int[m-l+1];
        int[] right = new int[h-m];
        for(int i= 0 ;i< m-l+1;i++){
            left[i] = arr[l+i];
        }
        for(int i=0;i<h-m;i++){
            right[i] = arr[m+1+i];
        }
        //now left and right arrays are assumed to be sorted and we have tp merge them together
        // int the original aaray.
        int i=l;
        int lindex = 0;
        int rindex =  0;

        while(lindex<m-l+1 && rindex<h-m){
            if(left[lindex]<=right[rindex]){
                arr[i]=left[lindex];
                lindex++;
                i++;
            }
            else{
                arr[i]=right[rindex];
                rindex++;
                i++;
            }
        }
        while(lindex<m-l+1){
            arr[i]=left[lindex];
            lindex++;
            i++;
        }
        while(rindex<h-m){
            arr[i]=right[rindex];
            rindex++;
            i++;
        }
    }

}


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

 public class gfg  {

    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int t = Reader.nextInt();
        while(t-->0){
            solve();
        }
        out.close();
    }
    static int n =0,m=0;
    static long mod =1000000007;
    static int MOD = 1000000007;
    static int[] dx = {0,0,1,-1};
    static int[] dy = {1,-1,0,0};
    //static int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};
    static ArrayList<Integer>[] graph;
    static int first=0,dist=0,max=0;
    static int[] dep;
    static HashSet<Integer> set = new HashSet<>();

    static void solve() throws IOException{
        int n = Reader.nextInt();
        int[] arr = new int[n];
        int one=0;
        for(int i=0;i<n;i++){
            arr[i] =Reader.nextInt();
            if(arr[i]==1)
                one++;
        }
        if(one>=(n/2)){
            out.println(one);
            for(int i=0;i<n-one;i++)
                out.print(1+" ");
        }
        else{
            out.println(n-one);
            for(int i=0;i<n;i++)
                out.print(0+" ");
        }
        out.println();
    }

    // ggratest common divisor println
    static int gcd(int a , int b){
        if(b==0)
            return a;
        else
            return gcd(b,a%b);
    }

    // least common multiple
    static int lcm(int a, int b){
        return (a*b)/gcd(a,b);
    }

    // a^b
    static long fastpow(long a, long b){
        long res = 1;a=a%mod;
        while(b>0){
            if(b%2==1)
                res = (res*a)%mod;
            a = (a*a)%mod;
            b = b>>1;
        }
        return res;
    }

    // segment tree
   /* static void update(int ind, int l, int h, int pos, int v){
        if(l==h){
            seg[ind] = v;
            return;
        }
        int mid = (l+h)/2;
        if(pos<=mid)
            update(2*ind,l,mid,pos,v);
        else
            update(2*ind+1,mid+1,h,pos,v);
        seg[ind] = seg[2*ind]^seg[2*ind+1];
    }
    static int query(int ind, int l , int h, int ll , int hh){
        if(ll>hh)
            return 0;
        if(l==ll && h==hh)
            return seg[ind];
        int mid = (l+h)/2;
        return query(2*ind,l,mid,ll,Math.min(mid,hh)) ^ query(2*ind+1,mid+1,h,Math.max(mid+1,ll),hh);
    }*/
    // priority queue with comparator
    // PriorityQueue<Interval> pq = new PriorityQueue<>(new Comparator<Interval>() {
    //             public int compare(Interval a, Interval b){
    //                 int diff1 = a.r - a.l;
    //                 int diff2 = b.r - b.l;

    //                 if(diff1 == diff2){
    //                     return a.l - b.l;
    //                 }

    //                 return diff2 - diff1;
    //             }
    // });
}

class trienode{
        int v;
        trienode[] child ;
        boolean leaf;
        int cnt;
        int p=0;
        trienode(int vv){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=vv;
        }
        trienode(){
            child = new trienode[2];
            leaf=false;
            cnt=0;
            v=0;
        }
    }
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class newcomparator implements Comparator<Integer>{
    //@Override
    public int compare(Integer a, Integer  b){
        return a<=b?1:-1;
    }
 }
class node {
    int f;
    int s;// cost to rreach\
    node(int ff,int ss){
        f=ff;
        s=ss;
    }
}
class mergesort{
    static void sort(int l, int h, int[] arr){
        if(l<h){
            int mid = (l+h)/2;

            sort(l,mid,arr);
            sort(mid+1,h,arr);
            merge(l,mid,h,arr);
        }
    }
    static void merge(int l, int m , int h , int [] arr){

        int[] left = new int[m-l+1];
        int[] right = new int[h-m];
        for(int i= 0 ;i< m-l+1;i++){
            left[i] = arr[l+i];
        }
        for(int i=0;i<h-m;i++){
            right[i] = arr[m+1+i];
        }
        //now left and right arrays are assumed to be sorted and we have tp merge them together
        // int the original aaray.
        int i=l;
        int lindex = 0;
        int rindex =  0;

        while(lindex<m-l+1 && rindex<h-m){
            if(left[lindex]<=right[rindex]){
                arr[i]=left[lindex];
                lindex++;
                i++;
            }
            else{
                arr[i]=right[rindex];
                rindex++;
                i++;
            }
        }
        while(lindex<m-l+1){
            arr[i]=left[lindex];
            lindex++;
            i++;
        }
        while(rindex<h-m){
            arr[i]=right[rindex];
            rindex++;
            i++;
        }
    }

}


//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(sum0 >= sum1){
                System.out.println(sum0);
                for (int i = 0; i < sum0; i++) {
                    System.out.print(0 + " ");
                }
                System.out.println("");
            }
            else{
                System.out.println(sum1%2 != 0 ? --sum1 : sum1);
                for (int i = 0; i < sum1; i++) {
                    System.out.print(1 + " ");
                }
                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++;
            }
            Arrays.sort(a);
            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--;
            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();
//            }
        }
    }
}


//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];
            addarr(a, n);
            Arrays.sort(a);
            for (int i = n-1; i >= 0; i--) {
                if(a[i]%2 == 0)
                    System.out.print(a[i] + " ");
            }
            for (int i = n-1; i >= 0; i--) {
                if(a[i]%2 != 0)
                    System.out.print(a[i] + " ");
            }
            System.out.println();
//            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();
//            }
        }
    }
}


//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];
            ArrayList<Integer> l = new ArrayList<>();
            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){
                for (int i = 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();
            }
        }
    }
}