T = gets.to_i T.times do n = gets.to_i ans = "0" * n a = 0 b = 0 (1 .. n).reverse_each do |i| if a < b a += i ans[i - 1] = ?0 else b += i ans[i - 1] = ?1 end end if a == b puts ans else puts -1 end end