# coding: utf-8

class Circles
  def solve
    n = gets.chomp.to_i
    n.times do
      xa, ya, ra, xb, yb, rb =
        gets.chomp.split.map{|s| s.to_f}
      #puts "#{xa}, #{ya}, #{ra}, #{xb}, #{yb}, #{rb}"

      #a, b間の距離
      d = Math.sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya))

      if d > (ra + rb) then
        puts "0"
      elsif d < (ra - rb).abs then
        puts "2"
      elsif d < (rb - ra) then
        puts "1"
      else
        puts "-1"
      end
    end
  end
end

Circles.new.solve