#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} void solve(){ int n; cin >> n; int s = n * (n + 1) / 2; if(s % 2){ cout << "-1\n"; return; } s /= 2; string ans; rep(i, n) ans += '0'; for(int x = n; x >= 1; x--){ if(s >= x){ s -= x; ans[x - 1] = '1'; } } cout << ans << "\n"; } int main(){ int t; cin >> t; rep(_, t) solve(); return 0; }