#include <iostream>
#include <cmath>
using namespace std;

int main() {
  int n;
  double xa,ya,ra;
  double xb,yb,rb;
  
  cin>>n;

  for(int i=0; i<n; i++) {
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    
    double d = sqrt( (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya) );
    int res;
    
    if(ra+rb<d) res=0;
    else if(ra+rb==d) res=1;
    else if( abs(ra-rb)<d && d<ra+rb) res=1;
    else if( d<=ra-rb ) res=2;
    else if( d<=rb-ra ) res=-2;
    
    cout << res << endl;
  }
    
  return 0;
}