#include <iostream>
//#include <algorithm>
#include "math.h"

using namespace std;

int main(){
	int count;
	double xa,ya,ra,xb,yb,rb;
	cin >> count;
	for(int i=0;i<count;i++){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double dist = pow((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb),0.5);
		//		double dist = (xa-xb)*(xa-xb)+(xa-xb)*(xa-xb);
		//cout << dist << endl;
		if(dist>ra+rb){
			cout << 0 << endl;
		}
		else if(dist > ra - rb && dist > rb - ra){
			cout << 1 << endl;
		}
		else if(ra>rb){
			cout << 2 << endl;
		}
		else{
			cout << -2 << endl;
		}
	}
}		