#include <stdio.h>
#include <math.h>
typedef struct En{
	double x,y,r;
};
int main(){
	En a,b;
	double dist,r;
	int n;
	scanf("%d",&n);
	while(n--){
		scanf("%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
		dist = (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
		r = (a.r+b.r)*(a.r+b.r);
		a.r = a.r*a.r;b.r = b.r*b.r;
		if(dist>r) printf("0\n");
		else if(a.r>b.r+dist) printf("2\n");
		else if(b.r>a.r+dist) printf("-2\n");
		else printf("1\n");
	}
	return 0;
}