Problem: Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stage.

There is at most one checkpoint on each stage, and there is always a checkpoint on the 1-st stage. At the beginning of the game, only the checkpoint on the 1-st stage is activated, and all other checkpoints are deactivated. When the player gets to the i-th stage that has a checkpoint, that checkpoint is activated.

For each try of a stage, the player can either beat the stage or fail the stage. If they beat the i-th stage, the player is moved to the i+1-st stage. If they fail the i-th stage, the player is moved to the most recent checkpoint they activated, and they have to beat the stages after that checkpoint again.

For example, assume that n = 4 and the checkpoints are on the 1-st and 3-rd stages. The player starts at the 1-st stage. If they fail on the 1-st stage, they need to retry the 1-st stage because the checkpoint on the 1-st stage is the most recent checkpoint they activated. If the player beats the 1-st stage, they're moved to the 2-nd stage. If they fail it, they're sent back to the 1-st stage again. If they beat both the 1-st stage and the 2-nd stage, they get to the 3-rd stage and the checkpoint on the 3-rd stage is activated. Now whenever they fail on the 3-rd stage, or the 4-th stage after beating the 3-rd stage, they're sent back to the 3-rd stage. If they beat both the 3-rd stage and the 4-th stage, they win the game.

Gildong is going to build the stages to have equal difficulty. He wants you to find any series of stages and checkpoints using at most 2000 stages, where the [expected number](https://en.wikipedia.org/wiki/Expected_value) of tries over all stages is exactly k, for a player whose probability of beating each stage is exactly \cfrac{1}{2}.

Input

Each test contains one or more test cases. The first line contains the number of test cases t (1 ≤ t ≤ 50).

Each test case contains exactly one line. The line consists of a single integer k (1 ≤ k ≤ 10^{18}) — the expected number of tries over all stages Gildong wants to set for a player whose probability of beating each stage is exactly \cfrac{1}{2}.

Output

For each test case, print -1 if it's impossible to construct such a series of stages and checkpoints using at most 2000 stages.

Otherwise, print two lines. The first line should contain a single integer n (1 ≤ n ≤ 2000) – the number of stages. The second line should contain n integers, where the i-th integer represents whether the i-th stage has a checkpoint. The i-th integer should be 0 if the i-th stage doesn't have a checkpoint, and 1 if it has a checkpoint. Note that the first integer must be 1 according to the description.

Example

Input


4
1
2
8
12


Output


-1
1
1
4
1 1 1 1
5
1 1 0 1 1

Note

In the first and the second case, we can see that the 'easiest' series of stages is to have 1 stage with a checkpoint. This already requires 2 tries in expectation, so it is impossible to make it to require only 1 try.

In the third case, it takes 2 tries in expectation to beat each stage, and the player can always retry that stage without falling back to one of the previous stages if they fail it. Therefore the total expected number of tries is 8. Note that there exists an answer with fewer stages, but you are not required to minimize the number of stages used. 

Solution (in JAVA):

Solution:
//note: 0<=|int|<= 2 * 10^9
//note: 0<=|long|<= 9 * 10^18
//note: 20! max w/ long
//note: 91st fibonacci # highest calculable w/long
//note: 0 <= |double| <= 1.8 * 10^308
//note: 170! max w/double;
//java machine can make 10^8 computations in a second.
import java.io.*;
import java.util.*;
import static java.lang.Math.max;
import static java.lang.Math.min;
    
public class CP{
    static int MAX = Integer.MAX_VALUE, MIN = Integer.MIN_VALUE;
    static FastScanner sc = new FastScanner();
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static int eulerIndex = 0;
    public static void main(String[] args){
        solve();    
        out.close();
    }
    
    static void solve() {
    	int t = sc.nextint();
    	while(t-->0) {
    		long n = sc.nextlong();
    		if(n%2 == 1) {
    			out.println(-1);
    			continue;
    		}
    		StringBuilder sb = new StringBuilder();
    		while(n > 0) {
    			StringBuilder cur = new StringBuilder("1");
    			long startPow = 4;
    			if(n == 2) {
    				sb.append("1");
    				break;
    			}
    			if(n == 4) {
    				sb.append("11");
    				break;
    			}
    			while(startPow*2 <= n) {
    				startPow *= 2;
    				cur.append("0");
    			}
    			n -= startPow;
    			cur.append("1");
    			sb.append(cur);
    		}
    		if(sb.toString().length() <= 2000) {
    			out.println(sb.toString().length());
    			for(char c : sb.toString().toCharArray()) {
    				out.print(c + " ");
    			}
    		}
    		else {
    			out.println(-1);
    		}
    		out.println();
    	}
    	
    	out.close();
    }
    
    static class Edge{
    	Node from, to;
    	int dist, flow;
    	public Edge(Node from, Node to, int dist, int flow) {
    		this.from = from;
    		this.to = to;
    		this.dist = dist;
    		this.flow = flow;
    	}
    }
    
    static class Node{
        int id;
        Set<Node> adj = new HashSet<Node>();
        public Node(int id) {
            this.id = id;
        }
        void add(Node n) {
        	adj.add(n);
        }
    }
    
    static class UnionFind{
        public int numComponents;
        public int[] sz, id;
        public UnionFind(int size) {
            numComponents = size;
            sz = new int[size];
            id = new int[size];
            for(int i = 0; i < size; ++i) {
                id[i] = i;
                sz[i] = 1;
            }
        }
        
        public int find(int p) {
            int root = p;
            while(root != id[root]) {
                root = id[root];
            }
            while(p != root) {
                int next = id[p];
                id[p] = root;
                p = next;
            }
            return root;
        }
        
        public void unify(int p, int q) {
            int root1 = find(p);
            int root2 = find(q);
            
            if(root1 == root2) {
                return;
            }
            
            if(sz[root1] < sz[root2]) {
                sz[root2] += sz[root1];
                id[root1] = id[root2];
            }
            else {
                sz[root1] += sz[root2];
                id[root2] = id[root1];
            }
                
            --numComponents;
        }
    }
    
    static class RMQ{
        int leftMost, rightMost, min, max;
        RMQ lChild, rChild;
        public RMQ(int lb, int rb, int[] a) {
            leftMost = lb;
            rightMost = rb;
            if(lb == rb) {
                min = max = a[lb];
                return;
            }
            int mb = (lb+rb)/2;
            lChild = new RMQ(lb, mb, a); 
            rChild = new RMQ(mb+1, rb, a);
            min = Math.min(lChild.min, rChild.min); 
            max = Math.max(lChild.max, rChild.max);
        }
        
        public void pointUpdate(int index, int val) {
            if(leftMost == rightMost) {
                min = val;
                max = val;
                return;
            }
            if(index <= lChild.rightMost) {
                lChild.pointUpdate(index, val);
            }
            else {
                rChild.pointUpdate(index, val);;
            }
            min = Math.min(lChild.min, rChild.min);
            max = Math.max(lChild.max, rChild.max);
        }
        
        public int rangeMin(int lb, int rb) {
            if(rightMost < lb || leftMost > rb) {
                return Integer.MAX_VALUE;
            }
            else if(rightMost <= rb && leftMost >= lb) {
                return min;
            }
            return Math.min(lChild.rangeMin(lb, rb), rChild.rangeMin(lb,rb));
        }
        
        public int rangeMax(int lb, int rb) {
            if(rightMost < lb || leftMost > rb) {
                return Integer.MIN_VALUE;
            }
            else if(rightMost <= rb && leftMost >= lb) {
                return max;
            }
            return Math.max(lChild.rangeMax(lb, rb), rChild.rangeMax(lb,rb));
        }
    }
    
    static class SegTree{
        int lb, rb;
        int sum;
        SegTree lChild, rChild;
        
        public SegTree(int lb, int rb, int[] a) {
            this.lb = lb;
            this.rb = rb;
            if(lb==rb) {
                sum = a[lb];
                return;
            }
            int mb = (lb+rb)/2;
            lChild = new SegTree(lb, mb, a);
            rChild = new SegTree(mb+1, rb, a);
            recalc();   
        }
        
        public void recalc() {
            if(lb == rb) {
                return;
            }
            sum = lChild.sum + rChild.sum;
        }
        
        public void pointUpdate(int index, int val) {
            if(lb == rb) {
                sum = val;
                return;
            }
            if(index <= lChild.rb) {
                lChild.pointUpdate(index, val);
            }
            else {
                rChild.pointUpdate(index, val);
            }
            recalc();
        }
        
        public long rangeSum(int l, int r) {
            if(l <= lb && rb <= r) {
                return sum;
            }
            if(l > rb || r < lb) {
                return 0;
            }
            return lChild.rangeSum(l, r) + rChild.rangeSum(l, r);
        }
    }
    
    static long modInverse(long a, long b) {
        long bb = b, temp, q;
        long x0 = 0, x1 = 1;
        if(b == 1){
            return 1L;
        }
        while(a > 1){
            q = a/b;
            temp = b; b = a-(a/b)*b; a=temp;
            temp = x0; x0 = x1-q*x0; x1 = temp;
        }
        if(x1 < 0){
            x1 += bb;
        }
        return x1;
    }
    
    static long gcd(long a, long b) {
        if(a == 0) {
            return b;
        }
        return gcd(b%a, a);
    }
    
    static int gcd(int a, int b){
        if(a == 0){
            return b;
        }
        return gcd(b%a, a);
    }
    
    static BufferedReader br;
    static StringTokenizer st;
    
    static class FastScanner{
        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while(st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int[] readint(int n) {
            int[] res = new int[n];
            for(int i = 0; i < n; i++) {
                res[i] = nextint();
            }
            return res;
        }
        long[] readlong(int n) {
            long[] res = new long[n];
            for(int i = 0; i < n; i++) {
                res[i] = nextlong();
            }
            return res;
        }
        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;
        }
    }
}