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

int main(void){
	int n;
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++){
		double ax, ay, ar, bx, by, br;
		scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
		double x = pow(ax-bx,2);
		double y = pow(ay-by,2);
		double r = pow(ar+br,2);
		
		if( x+y > r){
			puts("0");
		}else if(x+y == r){
			puts("1");
		}else if(x+y < r){
			if(br<ar){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
	
	return 0;
}