#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
struct circle {
	double x;
	double y;
	double r;
};
int main() {
	enum ins{A_isin_B,B_isin_A,Intersect,isnot};
	vector<ins>l;
	circle c1, c2;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> c1.x >> c1.y >> c1.r >> c2.x >> c2.y >> c2.r;
		double dis = sqrt((c2.x - c1.x)*(c2.x - c1.x) + (c2.y - c1.y)*(c2.y - c1.y));
		if (c1.r + c2.r < dis)l.push_back(isnot);
		else if (dis + c1.r <= c2.r)l.push_back(A_isin_B);
		else if (dis + c2.r <= c1.r)l.push_back(B_isin_A);
		else l.push_back(Intersect);
	}
	for (ins i : l) {
		if (i == A_isin_B)cout << -2;
		else if (i == B_isin_A)cout << 2;
		else if (i == isnot)cout << 0;
		else cout << 1;
		cout << endl;
	}
}