def dist(x1, y1, x2, y2)
  return Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
end

gets.to_i.times do
  xa, ya, ra, xb, yb, rb  = gets.split.map(&:to_f)
  d = dist(xa, ya, xb, yb)
  
  if d > ra + rb
    puts 0
  else
    if d > (ra - rb).abs
      puts 1
    else
      if ra > rb
        puts 2  
      else
        puts -2
      end
    end
  end
end