def solve(N): if N % 4 in [1, 2]: return -1 else: ans = [0] * N if N % 4 == 0: for i in range(N // 4): ans[i] = ans[i + N // 2] = 1 else: for i in range(N // 4 + 1): ans[i] = ans[i + N // 2] = 1 return ''.join(map(str, ans)) T = int(input()) for _ in range(T): N = int(input()) result = solve(N) if result == -1: print(result) else: print(result)