#!/usr/local/bin/ruby
n=gets.to_i
n.times{
xa,ya,ra,xb,yb,rb=gets.split.map(&:to_f)
d=Math.sqrt((ya-xa)**2+(yb-ya)**2)
  if d < ra-rb
    puts "2"
  elsif d < rb-ra
    puts"-2"
  elsif d > ra +rb
  puts"0"
  else
    puts "1"
  end
}