t = int(input()) for i in range(t): n = int(input()) S = n * (n+1) // 2 if S % 2 != 0: print(-1) continue ans = [0] * n x = S // 2 for i in range(n, 0, -1): if x >= i: ans[i-1] = 1 x -= i print("".join(map(str, ans)))