import Control.Monad
main = do
    n <- readLn
    replicateM_ n (get2circle >>= \x -> print (judgeIntersection x))

judgeIntersection ((x1,y1,r1), (x2,y2,r2))
  | distance > r1+r2 = 0
  | distance + r1 < r2 = -2
  | distance + r2 < r1 = 2
  | otherwise        = 1
    where distance = sqrt $ (x1-x2)^2 + (y1-y2)^2

get2circle = do
    [x1,y1,r1,x2,y2,r2] <- fmap (map (read :: String -> Double).words) getLine
    return ((x1,y1,r1),(x2,y2,r2))