//Circles Intersection
//2Ì~ÌSÆ¼aª^¦çê½Æ«A»Ì2ÂÌ~ªÚµÄ¢é©Aàï³êÄ¢é©AðíçÈ¢©ð»è¹æ


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

double Square(double x){return x*x;}
double Distance(double x, double y)
{
	return sqrt(Square(x) + Square(y) );
}

int main(void)
{
	int n;
	cin >> n;
	while(n--)
	{
		double ax, bx, ay, by, ar, br;
		cin >> ax >> ay >> ar >> bx >> by >> br;

		//Ql@http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1251422802

		//à~ÌSðciA¼aðriAO~ÌSðcoA¼aðroÆ·éÆ
		//|ci-co|<=ro-ri@ÈçA®SÉàï·éEEEçµ¢
		double distance = Distance(ax-bx, ay-by);
		if(distance <= br - ar)	//BªAðàï
			cout << -2 << endl;
		else if(distance <= ar - br)	//AªBðàï
			cout << 2 << endl;
		//|ci-co| <= ar+br ËaÆbÍdÈé
		else if(distance <= ar+br)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}