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