def circle(xa, ya, ra, xb, yb, rb)
  distance = ((xa - xb) ** 2 + (ya - yb) ** 2) ** 0.5
  if distance >= ra + rb
    return 0
  else
    if distance <= (ra - rb).abs
      return (ra <=> rb) * 2
    else
      return 1
    end
  end
end
def main
  gets.to_i.times do
    puts circle(*gets.split(" ").map(&:to_f))
  end
end
main