#include<iostream>
#include<math.h>
using namespace std;
int main() {
	int N,i;
	float xa, ya, ra, xb, yb, rb,r;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		r = pow(pow(xb - xa, (float)2.0) + pow(yb - ya, (float)2.0), (float)1.0/2);
		if (r > ra + rb) {
			cout << 0 << endl;
		}
		else if (r <ra-rb){
			cout << 2 << endl;
		}
		else if (r < rb - ra) {
			cout << -2 << endl;
		}
		else {
			cout << 1 << endl;
		}
	}
	return 0;
}