for _ in range(T := int(input())): N = int(input()) S = N*(N+1)//2 if S%2 == 1: print(-1) continue S //= 2 ans = ['0']*N for i in range(1, N+1): S -= i ans[i-1] = '1' if S <= 0: break if S < 0: ans[-S-1] = '0' print("".join(ans))