include Math
def dis(a, b, x, y)
  return sqrt((a - x) ** 2 + (b - y) ** 2)
end
def f(one, two)
  dist = dis(*one[0..1], *two[0..1])
  if dist <= (one[2] < two[2] ? two[2] - one[2]: one[2] - two[2])
    return 2 * (one[2] <=> two[2])
  elsif dist <= one[2] + two[2]
    return 1
  else
    return 0
  end
end
gets.to_i.times do
  cood = gets.split(" ").map(&:to_f)
  puts f(cood[0..2], cood[3..5])
end