t = int(input()) for _ in range(t): n = int(input()) if n % 4 == 0: print('0110' * (n // 4)) elif n % 4 == 3: ans = ['0', '1', '1', '0'] * ((n + 1) // 4) ans.pop() ans[-3] = '1' ans[-2] = '0' ans[-1] = '0' ans[(n + 1) // 2 - 1] = '1' print(*ans, sep='') else: print(-1)