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:
import java.util.*;
import java.lang.*;
// StringBuilder uses java.lang
 
 
public class mC {
    
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = sc.nextInt();
        long[] powerTwo = new long[60];
        powerTwo[0] = 1;
        for (int i=0;i<59;i++){
            powerTwo[i+1]=2*powerTwo[i];
        }
        for (int test = 0; test < t; test++) {
            long n = sc.nextLong();
            StringBuilder st = new StringBuilder();
            
            int r = 0;
            int leng = 0;
            if ((n&2) > 0) {
                st.append("1 ");
                leng+=1;
            }
            for (int i=2;i<60;i++) {
                if ((n&powerTwo[i])>0) {
                    r+=1;
                    st.append("1 ");
                    for (int j=2;j<i;j++) {
                        st.append("0 ");
                    }
                    leng+=i;
                }
            }
            for (int i=0;i<r;i++) {
                st.append("1 ");
                // already accounted for length
            }
            if (n%2 == 0) {
                System.out.println(leng);
                System.out.println(st.toString());
            } else {
                System.out.println(-1);
            }
            
        }
        
        
    }
    
    public static int goodLeft(int n, int[] p) { // i.e. ... 4 5 6
        int begin = 0;
        for (int i=0;i<n;i++) {
            if (n-i-1==p[i]) {
                begin++;
            } else {
                break;
            }
        }
        return begin;
    }
    public static int goodRight(int n, int[] p) { // i.e. 6 5 4 ...
        int end = 0;
        for (int i=n-1;i>=0;i--) {
            if (i==p[i]) {
                end++;
            } else {
                break;
            }
        }
        return end;
    }
    public static int findNthInArray(int[] arr,int val,int start,int o) {
        if (o==0) {
            return start-1;
        } else if (arr[start] == val) {
            return findNthInArray(arr,val,start+1,o-1);
        } else {
            return findNthInArray(arr,val,start+1,o);
        }
    }
    public static ArrayList<Integer> dfs(int at,ArrayList<Integer> went,ArrayList<ArrayList<Integer>> connect) {
        for (int i=0;i<connect.get(at).size();i++) {
            if (!(went.contains(connect.get(at).get(i)))) {
                went.add(connect.get(at).get(i));
                went=dfs(connect.get(at).get(i),went,connect);
            }
        }
        return went;
    } public static int[] bfs (int at, int[] went, ArrayList<ArrayList<Integer>> queue, int numNodes, ArrayList<ArrayList<Integer>> connect) {
        if (went[at]==0) {
            went[at]=queue.get(numNodes).get(1);
            for (int i=0;i<connect.get(at).size();i++) {
                if (went[connect.get(at).get(i)]==0) {
                    ArrayList<Integer> temp = new ArrayList<>();
                    temp.add(connect.get(at).get(i));
                    temp.add(queue.get(numNodes).get(1)+1);
                    queue.add(temp);
                }
            }
            
        }
        if (queue.size()==numNodes+1) {
            return went;
        } else {
            return bfs(queue.get(numNodes+1).get(0),went, queue, numNodes+1, connect);
        }
    }
    public static long fastPow(long base,long exp,long mod) {
        if (exp==0) {
            return 1;
        } else {
            if (exp % 2 == 1) {
                long z = fastPow(base,(exp-1)/2,mod);
                return ((((z*base) % mod) * z) % mod);
            } else {
                long z = fastPow(base,exp/2,mod);
                return ((z*z) % mod);
            }
        }
    }
    public static long fastPow(long base,long exp) {
        if (exp==0) {
            return 1;
        } else {
            if (exp % 2 == 1) {
                long z = fastPow(base,(exp-1)/2);
                return ((((z*base)) * z));
            } else {
                long z = fastPow(base,exp/2);
                return ((z*z));
            }
        }
    }
    public static int firstLarger(int val,ArrayList<Integer> ok,int left,int right) {
        if (ok.get(right)<=val) {
            return -1;
        }
        if (left==right) {
            return left;
        } else if (left+1==right) {
            if (val<ok.get(left)) {
                return left;
            } else {
                return right;
            }
        } else {
            int mid = (left+right)/2;
            if (ok.get(mid)>val) {
                return firstLarger(val,ok,left,mid);
            } else {
                return firstLarger(val,ok,mid+1,right);
            }
        }
    }
}