main = do
  n <- getLine
  s <- getContents
  putStr $ sUnlines $ map judge $ mReadSD $ linesWords s

linesWords s = map words $ lines s
mReadSD    s = map (map (read :: String -> Double)) s
sUnlines   s = unlines $ map show s

judge [xa,ya,ra,xb,yb,rb]
  | x_b >  (ra + rb)      =  0
  | x_b >= abs (ra - rb)  =  1
  | ra > rb               =  2
  | otherwise             = (-2)
  where
    x_b = sqrt ((xa-xb)^2 + (ya-yb)^2)