class Circle
  def initialize
    @n = $stdin.gets.chomp.to_i
    @result = []

    @n.times do
      @xa,@ya,@ra,@xb,@yb,@rb = $stdin.gets.chomp.split(' ').map(&:to_f)
      @d = calc_distance
      if @d >= @ra+@rb
        @result << "0"
        next
      end
      if @ra > @rb
        if check_a
          @result << "2"
          next
        end
      else
        if check_b
          @result << "-2" 
          next
        end
      end  
      @result << "1"
    end

    @result.each do |n|
      puts n
    end
  end

  def calc_distance
    a = @xa - @xb
    b = @ya - @yb
    dist = Math::sqrt(a*a+b*b)
  end

  def check_a
    @d + @rb < @ra
  end

  def check_b
    @d + @ra < @rb
  end
end

c = Circle.new