import Control.Applicative
import Control.Monad
main = do
  n <- (read::String->Int) <$> getLine
  v <- replicateM n (map read . words <$> getLine)
  mapM_ (putStrLn . show . aux) v

aux :: [Double] -> Int
aux [xa,ya,ra,xb,yb,rb]
  | ab > ra + rb = 0
  | ab + rb < ra = 2
  | ab + ra < rb = -2
  | otherwise = 1      
  where ab = sqrt((xb-xa)^2 + (yb-ya)^2)