#include <iostream>
#include <math.h>
using namespace std;

int main()
{
	int num;
	double xa,xb,ya,yb,ra,rb;
	double dist;
	cin >> num;
	for( int i = 0; i < num; i++ ) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		
		dist = sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) );
		if( dist > ra + rb ) {
			cout << 0 << endl;
		}
		else if( ra - dist > rb) {
				cout << 2 << endl;
		}
		else if( rb - dist > ra) {
				cout << -2 << endl;
		}
		else
			cout << 1 << endl;
	}

	return 0;
}