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

  l = Math.sqrt((xa - xb)**2 + (ya - yb)**2)

  if l + rb < ra
    puts 2
  elsif l + ra < rb
    puts -2
  elsif l > ra + rb
    puts 0
  else
    puts 1
  end
end