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

int main(){
	float x1, x2, x3;
	float y1, y2, y3;
	int n, i;

	scanf("%d", &n);

	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f", &x1, &x2, &x3, &y1, &y2, &y3);

		if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) > (x3 + y3)*(x3 + y3))
			printf("0\n");
		else if((y2-x2)*(y2-x2)+(y1-x1)*(y1-x1) < (x3 - y3)*(x3 - y3)){
			if((x3 -y3) >0)
				printf("2\n");
			else
				printf("-2\n");
		}
		else
			printf("1\n");
	}
	return 0;
}