#include <iostream>
#include <vector>
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<double> xa,ya,ra,xb,yb,rb;
	for(int i=0;i<n;i++){
		double o,p,q,r,s,t;
		cin>>o>>p>>q>>r>>s>>t;
		xa.push_back(o);
		ya.push_back(p);
		ra.push_back(q);
		xb.push_back(r);
		yb.push_back(s);
		rb.push_back(t);
	}
	for(int j=0;j<n;j++){
		double l = (xb[j]-xa[j])*(xb[j]-xa[j]) + (yb[j]-ya[j])*(yb[j]-ya[j]);
		if(ra[j]>rb[j] && l<(ra[j]-rb[j])*(ra[j]-rb[j])){
			cout<<"2"<<endl;
		}else if(ra[j]<rb[j] && l<(rb[j]-ra[j])*(rb[j]-ra[j])){
			cout<<"-2"<<endl;
		}else if(l<(ra[j]+rb[j])*(ra[j]+rb[j])){
			cout<<"1"<<endl;
		}else{
			cout<<"0"<<endl;
		}
	}
	return 0;
}