#include <iostream>
#include <cmath>
using namespace std;
double EPS=1e-10;
double add(double a, double b)
{
	if(abs(a+b)<EPS*(abs(a)+abs(b)) ) return 0;
	else return a+b;
}
int main()
{
	int n ; cin >> n ;
	while(n--)
	{
		double x[2],y[2],r[2];
		for(int i=0;i<2;i++) cin >> x[i] >> y[i] >> r[i] ;
		double dist2=add( (x[1]-x[0])*(x[1]-x[0]),(y[1]-y[0])*(y[1]-y[0]) );
		int ans=0;
		if(dist2<r[0]*r[0]) ans=2;
		else if(dist2<r[1]*r[1]) ans=-2;
		else if(dist2<=add(r[0],r[1])*add(r[0],r[1])) ans=1;
		cout << ans << '\n' ;
	}
}