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