# 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}

      d = Math::sqrt((xb - xa) ** 2 + (yb - ya) ** 2)

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

Circles.new.solve