#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n = 0;
	std::vector<int> a;
	double xa, ya, ra, xb, yb, rb;

#if INPUT_FROM_FILE
	//std::ifstream ifs("test.txt");
	FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	fscanf(fp, "%d", &n);
#else
	scanf("%d", &n);
#endif
	
	for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
		fscanf(fp, "%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#else
		scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
#endif

		double d = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));

		if(d > ra + rb){
			std::cout << 0 << std::endl;
		}
		else if(d + rb < ra){
			std::cout << 2 << std::endl;
		}
		else if(d + ra < rb){
			std::cout << -2 << std::endl;
		}
		else{
			std::cout << 1 << std::endl;
		}
	}
	return 0;
}
