#include #include using namespace std; int main() { int T; cin >> T; while (T--) { int N; cin >> N; int n = 0; for (int i = 0; i <= N; i++) { n += i; } if (n % 2 == 0) { vector B(N, false); int s = n / 2; for (int i = N; i > 0; i--) { if (s >= i) { s -= i; B[i - 1] = true; } } for (int i = 0; i < N; i++) { if (B[i]) { cout << 1; } else { cout << 0; } } cout << endl; } else { cout << -1 << endl; } } }