#include <iostream>
#include <cmath>

using namespace std;

void judge(double, double, double, double, double, double);

int main() {

	double xa, ya, ra, xb, yb, rb, N;

	cin >> N;

	for(int i=0; i<N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		judge(xa, ya, ra, xb, yb, rb);
	}

	return 0;

}

void judge(double xa, double ya, double ra, double xb, double yb, double rb) {

	double d=sqrt(pow(xa-xb, 2)+pow(ya-yb, 2));

	if(ra+rb<d)
		cout << "0" << endl;
	else if(ra+rb>d&&d>abs(ra-rb)||ra+rb==d)
		cout << "1" << endl;
	else if(ra-rb>d)
		cout << "2" << endl;
	else if(rb-ra>d)
		cout << "-2" << endl;

}