#include<string>
#include<cmath>
#include<iostream>

using namespace std;
 
int main(){
	int n, ans;
	double xa,ya,ra,xb,yb,rb,ab;

	cin >>n;
	while(n--){
		cin >>xa>>ya>>ra>>xb>>yb>>rb;
		
		ab=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		ans=1;
		if(ab>(ra+rb)) ans=0;
		if(ra>(ab+rb)) ans=2;
		if(rb>(ab+ra)) ans=-2;

		cout << ans << endl;
    }
    return 0;
}