#include #include using namespace std;using namespace atcoder;using vst = vector;using ll = long long; using ld = long double;using pll = pair;using vll = vector;using vvll = vector; #define rep(i, n) for (ll i = 0; i < n; i++) #define repp(i,k,n) for (ll i = k; i < n; i++) #define per(i,s,e) for(ll i = s; i >= e; i--) #define all(v) v.begin(),v.end() #define no() {cout << "No" << endl; return 0;} #define yes() {cout << "Yes" << endl;return 0;} #define CHECK(a) a ? cout << "Yes" << endl : cout << "No" << endl #define UNOmap unordered_map #define UNOset unordered_set #define ASC(T) T,vector,greater templatevoid in(T&... a){(cin >> ... >> a);} templatevoid out(const T& a, const Ts&... b){cout << a;((cout << ' ' << b), ...);cout << '\n';} void vin(vll &v){for(ll i = 0; i < (ll)v.size(); i++)in(v[i]);} void vout(vll &v){for(ll i = 0; i < (ll)v.size(); i++) cout << v[i] << ' ';} ll INF = 1LL << 62;ll MODD = 998244353;ll MOD = 1000000007; // using mint = modint998244353; //using mint = modint1000000007; //using mint = modint; //---------------------------------------------- int main(){ ll T; in(T); rep(test,T){ ll N; in(N); ll sum = N*(N+1)/2; if(sum % 2 == 1){ out(-1); continue; } set reds; ll cur = sum/2; per(num,N,0){ if(num <= cur){ cur -= num; reds.insert(num); } } repp(i,1,N+1){ if(reds.count(i)) cout << '1'; else cout << '0'; } cout << endl; } }