n = STDIN.gets.chomp.to_i
n.times do 
  xa, ya, ra, xb, yb, rb = STDIN.gets.chomp.split(" ").map { |item| item.to_f }
  dist = Math.sqrt(Math.pow(xa-xb, 2) + Math.pow(ya-yb, 2))
  if ra > rb && dist < rb - ra then
    puts 2
  elsif rb > ra && dist < rb - ra then
    puts -2
  elsif dist <= ra + rb && dist >= ra - rb then
    puts 1
 else 
    puts 0
  end
end