#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*ra)
	cout<<2<<endl;
       else if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)<rb*rb)
	cout<<-2<<endl;
       else if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)<=(ra+rb)*(ra+rb))
	 cout<<1<<endl;
    }
    return 0;
}
