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

int main()
{
	int number;
	double x1,y1,r1,x2,y2,r2,d;
	
	cin >> number;
	while(number--)
	{
		cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
		d = sqrt((x2-x1) * (x2-x1) + (y2-y1) * (y2-y1));

		if(d > r1 + r2)
		{
			cout << 0 << endl;
		}
		else if(d < r1- r2)
		{
			cout << 2 << endl;
		}
		else if(d < r2-r1)
		{
			cout << -2 << endl;
		}
		else
		{
			cout << 1 << endl;
		}
	}
	return 0;
}