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

inline float distance(float xa, float ya, float xb, float yb){
	return std::sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
}

inline int judge(std::vector<float> ve){
	float center_dis = distance(ve[0], ve[1], ve[3], ve[4]);
	float r_dis = ve[2] + ve[5];
	if(center_dis > r_dis){
		return 0;	
	}else{
		if(ve[2] > ve[5]){
			return center_dis + ve[5] <= ve[2] ? 2 : 1;
		}else{
			return center_dis + ve[2] <= ve[5] ? -2 : 1;
		}
	}
}

int main(void){
	int num;
	std::vector<float> ve(6);

	std::cin >> num;

	for(int i = 0; i < num; ++i){
		std::cin >> ve[0] >> ve[1] >> ve[2] >> ve[3] >> ve[4] >> ve[5];
		
		std::cout << judge(ve) << std::endl;
	}
	return 0;
}