t = int(input()) def check(m): num = (1 + m) * m // 2 if num % 2 != 0: return -1 else: ans = ["0"] * (m + 1) amari = num // 2 for i in range(m, 2, -1): if amari == 0: break if amari >= i: ans[i] = "1" amari -= i else: ans[amari] = "1" amari = 0 return "".join(ans[1:]) for i in range(t): n = int(input()) ans = check(n) print(ans)