#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double dx=xb-xa,dy=yb-ya;
		double d=sqrt(dx*dx+dy*dy);
		if(ra+rb<d) cout<<"0"<<endl;
		else if(ra>rb and ra-rb>d) cout<<"2"<<endl;
		else if(rb>ra and rb-ra>d) cout<<"-2"<<endl;
		else cout<<"1"<<endl;
	}
	return 0;
}