gets.to_i.times {
  xa, ya, ra, xb, yb, rb = gets.split.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 ra + rb < d 
    puts 0
  else
    puts 1
  end 
}