#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float x1, y1, r1, x2, y2, r2, u;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		u = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
		
		if(u+r2 < r1){
			cout << "2" << endl;
		} else if(u+r1 < r2){
			cout << "-2" << endl;
		} else if(u-r1 == r2 || ){
			cout << "1" << endl;
		} else {
			cout << "0" << endl;
		}
	}
	
	return 0;
}