import Control.Monad
import Control.Applicative
import Data.Char

splitBy :: (a -> Bool) -> [a] -> [[a]]
splitBy pred []  = []
splitBy pred str = a : (splitBy pred $ dropWhile pred b)
                 where (a, b) = break pred str

solve :: String -> Int
solve str = do
	let [x1, y1, r1, x2, y2, r2] = map read $ splitBy isSpace str :: [Double]
	let d = sqrt $ (dx * dx + dy * dy)
		where dx = x1 - x2
		      dy = y1 - y2
	if d > (r1 + r2)
		then 0
		else
			if (r2 + d) < r1
				then 2
				else
					if (r1 + d) < r2
						then (-2)
						else 1

main :: IO ()
main = do
	n <- readLn :: IO Int
	lines <- replicateM n getLine
	mapM_ print $ map solve lines