#include<iostream>
using namespace std;

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