#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int main(){
	int n,i;
	double xa,ya,ra,xb,yb,rb;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
		double d=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));
		if(d>ra+rb)printf("0\n");
		else if(d>abs(ra-rb))printf("1\n");
		else{
			if(ra>rb)printf("2\n");
			if(ra<rb)printf("-2\n");
		}
	}
	return 0;
}