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 CPP):

Solution:
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<list>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<ctime>
#include<algorithm>
#include<functional>
#include<tuple>

//#define SEG

#ifdef SEG

#define ls (2*x)
#define rs (2*x+1)
#define lson ls,l,mid
#define rson rs,mid+1,r
#define MID int mid=(l+r)/2

#endif

#define ll long long
#define ull unsigned long long
#define LD long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pdd pair<double,double>
#define pdi pair<double,int>
#define pid pair<int,double>
#define mk(a,b) make_pair(a,b)
#define mkt make_tuple
#define SZ(x) ((int)x.size())
const double pi=acos(-1);

const int maxn=200050;
const int maxm=200050;
#define mod 1000000007
//#define mod 998244353
#define eps 1e-8

using namespace std;

ll k;
string ans;

void work(int u)
{
    if(u==1) ans+='1';
    else{
        u-=2;
        ans+='1';
        while(u--) ans+='0';
        ans+='1';
    }
    return;
}

int main()
{
    int T;
    cin>>T;
    while(T--){
        scanf("%lld",&k);
        if(k%2){
            puts("-1");
            continue;
        }
        ans.clear();
        int i=1;
        while(k){
            k>>=1;
            if(k&1) work(i);
            i++;
        }
        printf("%d\n",SZ(ans));
        for(i=0;i<SZ(ans);i++){
            printf("%c%c",ans[i],i==SZ(ans)-1?'\n':' ');
        }
    }
    return 0;
}

/*

ll qpow(ll x,ll k){ll res=1;while(k){if(k&1)res=res*x%mod;k>>=1;x=x*x%mod;}return res;}
ll iv(ll x){return qpow(x,mod-2);}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll exgcd(ll l,ll r,ll &x,ll &y){if(r==0){x=1;y=0;return l;}else{ll d=exgcd(r,l%r,y,x);y-=l/r*x;return d;}}
 
struct SA{
    int rk[maxn],sa[maxn],height[maxn];
    int b[maxm],t1[maxm],t2[maxm];
    
    void get_sa(int *s,int n,int m)
    {
        int *x=t1,*y=t2;
        int i,k;
        for(i=0;i<=m;i++) b[i]=0;
        for(i=1;i<=n;i++) b[x[i]=s[i]]++;
        for(i=1;i<=m;i++) b[i]+=b[i-1];
        for(i=n;i>=1;i--) sa[b[x[i]]--]=i;
        for(k=1;k<=n;k<<=1){
            int num=0;
            for(i=n-k+1;i<=n;i++) y[++num]=i;
            for(i=1;i<=n;i++) if(sa[i]>k) y[++num]=sa[i]-k;
            
            for(i=0;i<=m;i++) b[i]=0;
            for(i=1;i<=n;i++) b[x[i]]++;
            for(i=1;i<=m;i++) b[i]+=b[i-1];
            for(i=n;i>=1;i--) sa[b[x[y[i]]]--]=y[i];
            
            swap(x,y);
            x[sa[1]]=1;
            num=1;
            for(i=2;i<=n;i++){
                x[sa[i]]=(y[sa[i]]==y[sa[i-1]]&&y[sa[i]+k]==y[sa[i-1]+k])?num:++num;
            }
            if(num==n) break;
            m=num;
        }
        for(i=1;i<=n;i++) rk[sa[i]]=i;
    }
    
    void get_height(int *s,int n)
    {
        int i,k;
        for(k=0,i=1;i<=n;i++){
            if(rk[i]==1) continue;
            if(k) k--;
            int j=sa[rk[i]-1];
            while(j+k<=n&&i+k<=n&&s[i+k]==s[j+k]) k++;
            height[rk[i]]=k;
        }
    }
};
 
 bool vis[maxn];
 int prime[maxn],cnt;
 int mu[maxn],pre[maxn];

 void get_mu()
 {
     int i,j;
     mu[1]=1;
     for(i=2;i<=maxn-10;i++){
         if(!vis[i]){
             prime[++cnt]=i;
             mu[i]=-1;
         }
         for(j=1;j<=cnt&&i*prime[j]<=maxn-10;j++){
             vis[i*prime[j]]=1;
             if(i%prime[j]==0) break;
             else mu[i*prime[j]]=-mu[i];
         }
     }
     for(i=1;i<=maxn-10;i++) pre[i]=pre[i-1]+mu[i];
 }
 
*/


/*
struct edge{
    int to;
    int val;
    int nxt;
    edge(int to_=0,int val_=0,int nxt_=0){
        to=to_;
        val=val_;
        nxt=nxt_;
    }
}E[maxm];

int head[maxn];
int cnt;

void init()
{
    cnt=0;
    memset(head,-1,sizeof(head));
}

void add(int u,int v,int w)
{
    E[cnt]=edge(v,w,head[u]);
    head[u]=cnt++;
}
 */