require 'scanf'

n = gets.to_i
n.times do
  xa, ya, ra, xb, yb, rb = gets.scanf("%f %f %f %f %f %f")
  r = Math.sqrt( (xa-xb)**2 + (ya-yb)**2 )

  puts case
       when r > ( ra + rb )
         0
       when r == ( ra + rb )
         1
       when r < ra
         2
       when r < rb
         -2
       end
end