#pragma GCC optimize("Ofast") #include 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(chrono::duration_cast(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; for (int i = 1; i <= n; ++i) { if (s >= i) { s -= i; cout << 0; } else { cout << 1; } } cout << "\n"; } } }