import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val N = sc.nextInt()
    for (i in 1..N) {
        val (xa, ya, ra) = Array(3, { sc.nextDouble() })
        val (xb, yb, rb) = Array(3, { sc.nextDouble() })
        val dist = Math.hypot(xa-xb, ya-yb)
        val ans = when {
            dist < ra-rb -> 2
            dist < rb-ra -> -2
            dist <= (ra+rb) -> 1
            else -> 0
        }
        println(ans)
    }
}
