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

int main(){
	int n,ans;
	double xa,ya,ra;
	double xb,yb,rb;
	double ab;
	
	cin>>n;
	while(n--){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		ab=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		ans=1;
		if(ab>(ra+rb))ans=0;
		else if(ra>(ab+rb))ans=2;
		else if(rb>(ab+ra))ans=-2;
		cout<<ans<<endl;
		

	}

}