require 'scanf'
require 'matrix'

n = STDIN.gets.to_i
for i in 0..n-1 do
    str = STDIN.gets
    xa,ya,ra,xb,yb,rb=\
        str.scanf("%f %f %f %f %f %f\n") 
    ab=Vector[xa-xb,ya-yb].norm
    #b in a
    if rb+ab < ra then
        print "2\n"
    #a in b
    elsif ra+ab < rb then
        print "-2\n"
    #crossed
    elsif ab <= ra+rb then
        print "1\n"
    else
        print "0\n"
    end
end