import Control.Monad
import Data.List

dist :: [Double] -> Double
dist [xa,ya,_,xb,yb,_] = sqrt $ (xa-xb)^2 + (ya-yb)^2

solve :: [Double] -> String
solve all@[xa,ya,ra,xb,yb,rb]
  | dist all > ra+rb = "0"
  | (dist all + ra) < rb = "-2"
  | dist all + rb < ra = "2"
  | otherwise = "1"

main = do
  n <- readLn
  xs <- replicateM n getLine

  putStr $ unlines $ map (solve . map read . words) xs