#include<bits/stdc++.h>
using namespace std;
long long int x[65];

int main(){
    for(int i=1;i<=60;i++){
        x[i]=((long long)1<<(i+1))-2;
    }
    int t;
    cin>>t;
    long long int k;
    for(int c=0;c<t;c++){
        cin>>k;
        if(k%2){
            cout<<-1<<endl;
            continue;
        }
        k-=2;
        int n=0;
        string ans="";
        for(int i=60;i>0;i--){
            if(k>=x[i]){
                n+=i;
                for(int j=0;j<i-1;j++){
                    ans+='0';
                }
                ans+='1';
                k-=x[i];
                if(k>=x[i]){
                    i++;
                }
            }
        }
        cout<<n+1<<endl;
        cout<<"1 ";
        for(int i=0;i<ans.length();i++){
            cout<<(char)ans[i]<<" ";
        }
        cout<<endl;
    }
}
