T = int(input()) for _ in range(T): N = int(input()) total = N*(N+1)//2 if total % 2 != 0: print(-1) else: half = total // 2 result = [0]*N for i in range(N, 0, -1): if half - i >= 0: result[i-1] = 1 half -= i print(''.join(map(str, result)))