#include <iostream>
#include <cmath>

double calcDistance(double x1, double y1, double x2, double y2){
	double d;
	d = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
	return d;
}

int main(){
	double xa, ya, ra;
	double xb, yb, rb;
	int num;
	std::cin >> num;
	
	while(num){
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = calcDistance(xa, ya, xb, yb);
		int answer = 1;
		
		if(ra + rb < d) 
			answer = 0;
		else if(ra - rb > d)
			answer = 2;
		else if(rb - ra > d)
			answer = -2;
			
		std::cout << answer << std::endl;
		--num;
	}


}