n = readline.chomp.to_i
n.times do |i|
  (xa, ya, ra, xb, yb, rb) = readline.chomp.split(' ').map(&:to_f)
  l = Math.sqrt((xb - xa) ** 2 + (yb - ya) ** 2)
  r = ra + rb
  if r < l
    p 0
  elsif (ra - rb).abs <= l and l <= ra + rb
    p 1
  else
    if ra > rb
      p 2
    else
      p -2
    end
  end
end