class Circle
  def compare(list)
    xa, ya, ra, xb, yb, rb = list
    cd = center_distance(xa, ya, xb, yb)
    return 0  if cd > (ra - rb).abs
    return 2  if cd + rb < ra
    return -2 if cd + ra < rb
    0
  end

  def center_distance(xa, ya, xb, yb)
    ((ya - yb)**2 + (xa - xb)**2)**(1 / 2.0)
  end
end

n = STDIN.gets.chomp.to_i
inputs = STDIN.read.split("\n").map { |e| e.split.map { |e| e.chomp.to_f } }
n.times do |i|
  puts Circle.new.compare(inputs[i])
end