main = do
  _ <- getLine
  s <- getContents
  let v = map (map read . words) . lines $ s
  mapM_ (putStrLn . show . aux) v

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