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