#include <iostream>
#include <math.h>

using namespace std;

struct Vector
{
	double x;
	double y;
};

istream& operator>>(istream& stream, Vector& p)
{
	return stream >> p.x >> p.y;
}

template <typename T>
T absolute(T x)
{
	return x > 0 ? x : -x;
}

int main()
{
	int length;
	cin >> length;

	while(length-- > 0)
	{
		Vector a, b;
		double ra, rb;
		cin >> a >> ra >> b >> rb;
		double dist = sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y));

		if(ra + rb < dist)
			cout << 0 << endl;
		else if(dist < absolute(ra - rb))
		{
			if(rb < ra)
				cout << 2 << endl;
			else
				cout << -2 << endl;
		}
		else
			cout << 1 << endl;
	}

	return 0;
}