#include <iostream>
using namespace std;

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