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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		float xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		complex<float> comp(xa - xb, ya -yb);
		float d = abs(comp);
		float r = ra + rb;
		if(d <= r){
			if(d < ra && rb < ra){
				cout << "2" << endl;
			}
			else if(d < rb && ra < rb){
				cout << "-2" << endl;
			}
			else{
				cout << "1" << endl;
			}
		}
		else{
			cout << "0" << endl;
		}
	}
	return 0;
}