n = int(input()) for i in range(n): test = int(input()) nums = sum([j + 1 for j in range(test)]) ans = ['0' for j in range(test)] check = nums // 2 if nums % 2 == 1: print(-1) continue else: for j in range(test + 1): if check == nums: print(''.join(ans)) break elif check < nums: nums -= (test - j) ans[test - j - 1] = '1' else: nums += (test - j) + 1 ans[test - j] = '0'