#include<iostream>
#include<cmath>

using namespace std;

struct point{
	double x;
	double y;
};

struct circle{
	point o;
	double r;
};

istream& operator >> ( istream& s , circle& x );
void swap( circle *a , circle *b );
double get_distance( const point& a , const point& b );

int main(void)
{
	circle a, b;
	int n;

	cin >> n;

	for( int i = 0 ; i < n ; i++ )
	{
		int flag = 0;
		int result;

		cin >> a >> b;

		if( a.r < b.r )
		{
			swap( a , b ); // 大きいほうの円は常にa
			flag = 1;
		}

		double distance = get_distance( a.o , b.o );
		double add_r = a.r + b.r;

		if( add_r < distance ){
			result = 0;
		}
		else{
			if( distance + b.r < a.r ){
				if( flag == 0 ) result = 2;
				else result = -2;
			}
			else result = 1;
		}
		cout << result << endl;
	}

	return 0;
}

istream& operator >> ( istream& s , circle& x )
{
	return s >> x.o.x >> x.o.y >> x.r;
}

void swap( circle *a , circle *b )
{
	circle temp;

	temp = *a;
	*a = *b;
	*b = temp;

	return;
}

double get_distance( const point& a , const point& b )
{
	return sqrt( pow( a.x-b.x , 2 ) + pow( a.y - b.y , 2 ) );
}