#include <iostream>
#include <cmath>
using namespace std;

int main(){
	int n;cin >> n;
	double x1, y1, r1, x2, y2, r2;
	while(n--){
		cin >>x1>>y1>>r1>>x2>>y2>>r2;
		double d = pow(y2-y1, 2)+pow(x2-x1, 2);
		d = sqrt(d);
		if(r1 + r2 >= d){
			int f = 0;
			if(d < r1){
				if(d+r1 <= r2)cout << -2 << endl;
				f = 1;
			}
			if(d < r2){
				if(d+r2 <= r1)cout << 2 << endl;
				f = 1;
			}
			if(!f)cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
		//cout << d << endl;
	}
	return 0; 
}