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

int main(void){
	int n = 0;
	float xa, ya, ra, xb, yb, rb;
	float d =0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%f %f %f %f %f %f",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra > d+rb){
			puts("2");
		}else if(rb > d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	return 0;
}