import Control.Monad (replicateM_)

type Point = (Double,Double)
type Radius = Double
type Circle = (Point,Radius)

main = do
    n <- readLn
    replicateM_ n (input >>= return . solve >>= output)

input :: IO (Circle,Circle)
input = do
    line <- getLine
    let
        [xa,ya,ra,xb,yb,rb] = map read $ words line
    return (((xa,ya),ra),((xb,yb),rb))

output :: String -> IO ()
output = putStrLn

solve :: (Circle,Circle) -> String
solve (((xa,ya),ra),((xb,yb),rb))
    | ra + rb < distance = "0"
    | distance + rb < ra = "2"
    | distance + ra < rb = "-2"
    | otherwise = "1"
    where
    distance = sqrt ((xa-xb)^2 + (ya-yb)^2)