#include<iostream>
#include<cmath>
using namespace std;
int N;
struct C{
	double x,y,r;
};
main()
{
	cin>>N;
	for(;N--;)
	{
		C a,b;
		cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
		double d=hypot(a.x-b.x,a.y-b.y);
		cout<<(d>a.r+b.r?0:d<a.r-b.r?2:d<b.r-a.r?-2:1)<<endl;
	}
}

