# encoding: utf-8                                                            

gets.to_i.times {
  xa, ya, ra, xb, yb, rb = gets.split(/\s/).map(&:to_f)
  d = Math.sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

  if d + rb < ra
    puts "2"
  elsif d + ra < rb
    puts "-2"
  elsif d > ra + rb
    puts "0"
  else puts "1"
  end
}