n = gets.to_i
n.times do
  xa, ya, ra, xb, yb, rb = gets.split.map(&:to_f)
  d = Math.sqrt( (xa - xb) ** 2 - (ya - yb) ** 2 )
  if ra > rb + d then
    puts 2
  elsif rb > ra + d then
    puts -2
  elsif d <= ra + rb then
    puts 1
  else
    puts 0
  end
end