#include using namespace std; using i64 = int64_t; int main() { cin.tie(nullptr)->sync_with_stdio(false); cout << fixed << setprecision(20); int t; cin >> t; for (int ti = 0; ti < t; ti += 1) { int n; cin >> n; if (n * (n + 1) / 2 % 2) { cout << "-1\n"; continue; } string s(n + 1, '0'); for (int i = n, sum = 0; i >= 0; i -= 1) { if (sum >= 0) { sum -= i; s[i] = '1'; } else { sum += i; } } cout << s.substr(1) << "\n"; } }