#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int q; cin >> q;
    while (q--) {
        int n; cin >> n;
        int s = n*(n+1)/2;
        if (s%2 == 1) {
            cout << -1 << "\n";
        }
        else {
            s /= 2;
            string res;
            for (int i = n; i >= 1; --i) {
                if (s >= i) {
                    s -= i;
                    res += '0';
                }
                else {
                    res += '1';
                }
            }
            reverse(res.begin(), res.end());
            cout << res << "\n";
        }
    }
}