require "matrix"

#main
n = gets.to_i
arr = Array.new
n.times{arr << gets}
def dist(p1, p2)
   Math.sqrt((p1[1] - p2[1]) ** 2 + (p1[0] - p2[0]) ** 2)
end
def abs(x)
   if x < 0
      -x
   else
      x
   end
end
arr.each do |i|
   k = i.split(" ")
   k.map!{|j| j.to_f}
   pa = Vector[k[0], k[1]]
   ra = k[2]
   pb = Vector[k[3], k[4]]
   rb = k[5]
   d = dist(pa, pb)
   if (ra + rb) < d
      c = 0
   elsif abs(rb - ra) <= d
      c = 1
   elsif rb > ra
      c = -2
   else
      c = 2
   end
   puts c
end