include Math
n = gets.to_i
n.times do
	xa,ya,ra,xb,yb,rb = gets.chomp.split.map { |i| i.to_f }
	oa_ob = sqrt((xa-xb)**2 + (ya-yb)**2)
	if oa_ob < ra-rb
		puts 2
	elsif oa_ob < rb-ra
		puts (-2)
	elsif oa_ob > ra+rb
		puts 0
	else
		puts 1
	end
end
		