#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int l[51];
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double distance = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
		if (distance <= abs(ra - rb)) {
			if (ra > rb)l[i] = 2;else l[i] = -2;
		}
		else if (distance > ra + rb)l[i] = 0;
		else l[i] = 1;
	}
	for (int i = 0; i < n; i++)
		cout << l[i] << endl;
	return 0;
}