#include <iostream>
#include <math.h>
using namespace std;

int main(void)
{
	int n, f;
	double xa, xb, ya, yb, ra, rb;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		double distance;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		if (ra > rb)
		{
			distance = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
			if (distance < (ra - rb)) f = 2;
			else if (distance >= (ra - rb) && distance <= (ra + rb)) f = 1;
			else f = 0;
		}
		else
		{
			distance = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
			if (distance < (rb - ra)) f = -2;
			else if (distance >= (rb - ra) && distance <= (rb + ra)) f = 1;
			else f = 0;
		}
		cout << f << endl;
	}
	return 0;
}
