#include<iostream>
#include<math.h>
using namespace std;

int main(){
	
	int n,z;
	double x1,y1,r1;
	double x2,y2,r2;
	
	cin>>n;
	
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> r1 ;
		cin >> x2 >> y2 >> r2 ;
		
		double m = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ) ;
		
		if( r1 >= m+r2 ) z=2;
		else if( r2 > m+r1 ) z=-2;
		else{
			if( r1+r2 >= m ) z=1;
			else z=0;
		}
		
		cout << z << endl;
	}
return 0;
}