def f(xa, ya, ra, xb, yb, rb)
  distance = (xa - xb) ** 2 + (ya - yb) ** 2
  if distance <= (ra + rb) ** 2
    if distance <= (ra - rb) ** 2
      return 2 * (ra <=> rb)
    else
      return 1
    end
  else
    return 0
  end
end
gets.to_i.times do
  coordinate = gets.split(" ").map(&:to_f)
  puts f(*coordinate)
end