module Circle =
  struct
    type t = { x: float; y:float; r:float }
    let eps = 1e-10
    let set x y r = {x = x; y = y; r = r}
    let dist c1 c2 = sqrt ((c1.x -. c2.x) *. (c1.x -. c2.x) +. (c1.y -. c2.y) *. (c1.y -. c2.y))
    let intersection c1 c2 = 
      let d = dist c1 c2 in
      if d -. c1.r -. c2.r > eps then 0
      else if c1.r -. c2.r -. d > eps then 2
      else if c2.r -. c1.r -. d > eps then -2
      else 1
  end

let _ = 
  let n = Scanf.scanf "%d\n" (fun x -> x) in
  for i = 1 to n do
    let c1,c2 = Scanf.scanf "%f %f %f %f %f %f\n" (fun xa ya ra xb yb rb -> (Circle.set xa ya ra, Circle.set xb yb rb)) in
    Printf.printf "%d\n" @@ Circle.intersection c1 c2
  done