#include using namespace std; int main() { int t; cin >> t; for (int j = 0; j < t; j++) { int n; cin >> n; if ((n * (n + 1) / 2 % 2) == 1) cout << -1 << endl; else { int x = (n + 1) * n / 4; vector res(n + 1, 0); for (int i = n; i >= 1; i--) { if (x >= i) { res[i]++; x -= i; } } for (int i = 1; i <= n; i++) { cout << res[i]; if (i == n) cout << endl; } } } }