#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int time;
	cin>>time;
	double round[6];
	for(int i=0;i<time;++i){
		for(int i2=0;i2<6;++i2){
			cin>>round[i2];
		}
		if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)>pow(round[5]+round[2],2.0)){
			cout<<0<<endl;
		}else if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)+pow(round[5],2.0)<pow(round[2],2.0)){
			cout<<2<<endl;
		}else if(pow(round[3]-round[0],2.0)+pow(round[4]-round[1],2.0)+pow(round[2],2.0)<pow(round[5],2.0)){
			cout<<-2<<endl;
		}else{
			cout<<0<<endl;
		}
	}
	return 0;
}