include Math

gets.to_i.times {
	xa, ya, ra, xb, yb, rb = gets.split.map(&:to_f)
	
	d = sqrt((xb - xa)**2 + (yb - ya)**2)

	if ra + rb < d then
		rt = 0
	elsif (ra - rb).abs <= d then
		rt = 1
	elsif ra - rb > d then
		rt = 2
	else
		rt = -2
	end

	puts rt
}