#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		pair<double, double>p1, p2;
		double r1, r2;
		cin >> p1.first >> p1.second >> r1;
		cin >> p2.first >> p2.second >> r2;
		double dis = sqrt(pow(p1.first - p2.first, 2) + pow(p1.second + p2.second, 2));
		if (dis > r1 + r2)cout << 0 << endl;
		else if (dis < r1 - r2)cout << 2 << endl;
		else if (dis < r2 - r1)cout << -2 << endl;
		else cout << 1 << endl;
	}
}