#include<bits//stdc++.h>
using namespace std;

int main(){
	double a,b,c,d,e,f;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c>>d>>e>>f;
		double z=sqrt(((d-a)*(d-a))+((e-b)*(e-b)));
		if(z<0){z*=-1;}
		
		if(c+f<z){cout<<'0'<<endl;}
		else if(z>f-c){cout<<"2"<<endl;}
		else if(z>c-f){cout<<"-2"<<endl;}
		else{cout<<"1"<<endl;}
		}
		return 0;
	}