#include <iostream>
#include <cmath>
#include <array>
#include <vector>

inline double distance(std::array<double, 2> pa,std::array<double, 2> pb){
	return sqrt( (pa[0] - pb[0])*(pa[0] - pb[0]) + (pa[1] - pb[1])*(pa[1] - pb[1]) );
}

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<int> number;
	for(int i = 0; i < dataSetNum; ++i){
		std::array<double, 2> pa[i];
		std::array<double, 2> pb[i];
		double ra[i],rb[i];

		std::cin >> pa[i][0] >> pa[i][1] >> ra[i] >> pb[i][0] >> pb[i][1] >> rb[i];
		//if A and B do not overlap
		if(distance(pa[i],pb[i]) > ra[i] + rb[i]) number[i] = 0;
		//if B is in A
		else if(ra[i] > rb[i] && distance(pa[i],pb[i]) + rb[i] <= ra[i]) number[i] = 2;
		//if A is in B,
		else if(rb[i] > ra[i] && distance(pa[i],pb[i]) + ra[i] <= rb[i]) number[i] = -2;
		//if circumference of A and B intersect
		else number[i] = 1;
	}
	for(int i = 0; i < dataSetNum; ++i) std::cout << number[i] << std::endl;
	return 0;
	}