import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete



f :: [Double] -> Int
f [xa,ya,ra,xb,yb,rb]
  | ra > rb && dr2 > d2 = 2
  | ra < rb && dr2 > d2 = -2
  | (ra + rb) ** 2 < d2 = 0
  | otherwise = 1
  
  where
    dr = rb - ra
    dr2 = dr ** 2
    dx = xb - xa
    dy = yb - ya
    d2 = dx ** 2 + dy ** 2
  

main = readLn >>= flip replicateM getLine >>= mapM_ (print . f . map read . words)