#include<iostream>
#include<cmath>
using namespace std;

int main() {
	double a, b, c, d, e, f;
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
	 {
		cin >> a >> b >> c >> d >> e >> f;

		double g = sqrt(((a + d)*(a + d) + (b + e)*(b + e)));
		if (g > c + f) { cout << "0" << endl; }
		else if (g < f - c) { cout << "-2" << endl; }
		else if (g < c - f){ cout << "2" << endl; }
		else { cout << "1" << endl; }
	}
	return 0;
}