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