#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, t, s; cin >> t; while(t--){ cin >> n; s = n*(n+1)/2; if (s%2 != 0){ cout << -1 << endl; continue; } s /= 2; string ans(n, '0'); for (int i=n; i>=1; i--){ if (s-i >= 0){ ans[i-1] = '1'; s -= i; } } cout << ans << endl; } return 0; }