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

class Point {
public:
	double x, y, r;
};

int main()
{
	int n;
	Point p1,p2;
	
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> p1.x >> p1.y >> p1.r>> p2.x >> p2.y >> p2.r;
		double sumR = p1.r + p2.r;
		double l = sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
		
		if (p1.r > p2.r) {
			double subR = p1.r - p2.r;
			if (l < subR) {
				cout << "2" << endl;
			}
			else if (l <= sumR && l >= subR) {
				cout << "1" << endl;
			}
			else if (l > sumR) {
				cout << "0" << endl;
			}
		}
		else {
			double subR = p2.r - p1.r;
			if (l < subR) {
				cout << "-2" << endl;
			}
			else if (l <= sumR &&  l >= subR) {
				cout << "1" << endl;
			}
			else if (l > sumR) {
				cout << "0" << endl;
			}
		}
	}
	return 0;
}
