#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N = 100; vector> dp(N+1,vector(N*N,-1)); dp[0][0] = 0; for (int i = 1; i <= N; i++){ for (int j = 0; j <= N*N; j++){ if (dp[i-1][j] == -1) continue; dp[i][j] = dp[i-1][j]; if (j+i > N*N) continue; dp[i][j+i] = j; } } int t; cin >> t; for (int i = 0; i < t; i++){ int n; cin >> n; int sum = n*(n+1)/2; if (sum & 1 ) { cout << -1 << endl; continue; } int half = sum / 2; if (dp[n][half] == -1){ cout << -1 << endl; continue; } vector ans(n); int now = half; for (int j = n;j > 0;j--){ int nex = dp[j][now]; if (nex == now) continue; ans[now-nex-1] = 1; now = nex; } for (auto a : ans){ cout << a; } cout << endl; } return 0; }