#include <iostream>
#include <cmath>
using namespace std;
int main( void )
{
  int n,t;
  double xa,ya,ra,xb,yb,rb,d;
  cin >> n;
  for( int i=0; i<n; i++ ){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    d = sqrt( (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya) );
    if( ra + rb < d ) t=0;
    else if( d + rb < ra ) t=2;
    else if( d + ra < rb ) t=-2;
    else t=1;
    cout << t << endl;
  }
  return 0;
}