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

int n, m;
double a, b, p, c, d, q, t;

int main()
{
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a >> b >> p >> c >> d >> q;

		t = sqrt((a - c) * (a - c) + (b - d) * (b - d));

		if (p + q < t)
			m = 0;
		else if (p - q > t)
			m = 2;
		else if (q - p > t)
			m = -2;
		else
			m = 1;

		cout << m << endl;
	}
}

