#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++;
}
 */
