#include #ifdef LOCAL #include "./debug.cpp" #else #define debug(...) #define print_line #endif using namespace std; using ll = long long; int main() { int T; cin >> T; while (T--) { int N; cin >> N; int M = N * (N + 1) / 2; if (M % 2 == 1) { cout << -1 << endl; } else { M /= 2; int now = 0, sum = 0; vector ans(N, '0'); while (sum + now + 1 <= M) { now++; sum += now; ans[now - 1] = '1'; } if (sum < M) { int d = M - sum; if (N - d <= now) { ans[N - d - 1] = '0'; ans[N - 1] = '1'; } else { ans[now - 1] = '0'; ans[now + d - 1] = '1'; } } for (int i = 0; i < N; i++) cout << ans[i]; cout << endl; } } }