
#include<iostream>

#include<math.h>
using namespace std;



int main(){

  int n;
  double xa,ya,xb,yb;
  double ra,rb;
  int out ;
  cin >> n;

  for(int i=0;i<n;i++){
    
    cin >> xa >> ya >> ra >> xb>> yb>>rb;

    double d= sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );//
    
    if(d<fabs(ra-rb)){//
      out = 2;
      if(ra<rb)out= -2;
          }
    else if(d>(ra+rb))out = 0;//
    else out =1;//
    
    cout << out << endl;
    
  }


  return 0;
}