#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ int n; cin >> n; if(n * (n + 1) % 4 != 0){ cout << -1 <<'\n'; continue; } int r = n * (n + 1) / 4; vector dp(r + 1, -2); dp[0] = -1; for(int i = 1; i <= n; i++){ for(int j = r - i; j >= 0; j--){ if(dp[j] == -2) continue; if(dp[i + j] == -2) dp[i + j] = i; } } if(dp[r] == -2){ cout << -1 << '\n'; continue; } string ans(n, '0'); while(dp[r] != -1){ ans[dp[r] - 1] = '1'; r -= dp[r]; } cout << ans << '\n'; } }