#!/usr/local/bin/ruby
a = Array.new
N = gets.to_i
N.times do
 a << gets.split(" ").map(&:to_f)
end
a.each do |xa,ya,ra,xb,yb,rb|
 l = Math::sqrt( (xb-xa)**2 + (yb-ya)**2 )
 if l+rb <= ra
  puts 2
 elsif l+ra <= rb
  puts -2
 elsif l <= ra+rb
  puts 1
 elsif l >= ra+rb
  puts 0
 end
end