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