n = gets.to_i

n.times do
  xa, ya, ra, xb, yb, rb = gets.split(/\s/).map(&:to_f)

  l = (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb)

  if ra > rb and (l + rb <= ra)
    puts 2
  elsif rb > ra and (l + ra <= rb)
    puts -2
  elsif l <= (ra + rb)
    puts 1
  elsif l > (ra + rb)
    puts 0
  end
end