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

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