T = int(input()) def calc(N): S = N * (N + 1) / 2 return S def greedy(N, S): num = [i for i in range(1, N + 1)] ans = [] s = [] for n in num: s.append(n) if sum(s) == S: for i in range(1, N + 1): if i in s: ans.append(1) else: ans.append(0) return ans if sum(s) > S: while s: s = s[1:] if sum(s) == S: for i in range(1, N + 1): if i in s: ans.append(1) else: ans.append(0) return ans return -1 for _ in range(T): N = int(input()) S = calc(N) if S % 2 == 1: print(-1) continue S //= 2 ans = greedy(N, S) if ans == -1: print(-1) else: print("".join(map(str, ans)))