T = int(input()) for _ in range(T): N = int(input()) v = N * (N + 1) // 2 if v % 2: print(-1) continue v //= 2 ans = [0] * N for i in range(N, 0, -1): if v >= i: v -= i ans[i - 1] = 1 print(*ans, sep="")