#include<iostream>
using namespace std;
int main(){
  int n;
  double x1,x2,y1,y2,r1,r2;

  while(cin>>n){
    for(int i=0;i<n;i++){
      cin>>x1>>y1>>r1>>x2>>y2>>r2;
      if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<(r1+r2)*(r1+r2)){
	if(r1>r2){
	  cout<<"2"<<endl;
	}
	else{
	  cout<<"-2"<<endl;
	}
      }
      else if ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)>(r1+r2)*(r1+r2)){
	cout<<"0"<<endl;
      }
      else{
	cout<<"1"<<endl;
      }
    }
  }
  return 0;
}