import scala.math.{sqrt, pow, abs}

object Main extends App {
  val src = io.Source.stdin.getLines.map(_.split(" ").map(_.toDouble))

  for (i <- 1 to src.next.head.toInt) {
    val Array(x1, y1, r1, x2, y2, r2) = src.next

    val distance = sqrt(pow(x1-x2, 2) + pow(y1-y2, 2))

    val relationShip = {
      if (distance <= abs(r1-r2)) 2
      else if (distance <= abs(r2-r1)) -2
      else if (distance >= abs(r1+r2)) 0
      else 1
    }
    println(relationShip)
  }
}