
import scala.io.StdIn.{readLine,readInt}

object Main {

  def main(args:Array[String]) = {
    val b = new StringBuilder
    val n = readInt
    for(i<- 1 to n) {
      val p = readLine.split(" ").map(_.toDouble)
      val d = Math.sqrt(Math.pow(p(0)-p(3),2) + Math.pow(p(1)-p(4),2))
      if(d+p(5) < p(2))
        b.append("2\n")
      else if(d+p(2)<p(5))
        b.append("-2\n")
      else if(d > p(2) + p(5))
        b.append("0\n")
      else
        b.append("1\n")
    }
    print(b.result)
  }
}