#include<stdio.h>
#include<math.h>
#define EPS 1e-9
int n;
double xa,ya,ra,xb,yb,rb;

int main(){
	int i;
	scanf("%d",&n);
	
	for( i = 0;i < n;i++ ){
		scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
		
		//BがA中にあるか(境界ふくむ)
		if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && rb < ra )
			printf("2\n");
		//AがB中にあるか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra-rb)*(ra-rb) && ra < rb )
			printf("-2\n");
		//AとBが交わっているか(境界ふくむ)
		else if( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) <= (ra+rb)*(ra+rb) )
			printf("1\n");
		else
			printf("0\n");
	}
	return 0;
}