#include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

int main() {
  int n;
  cin >> n;
  for( int i = 0; i < n; i++ ) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    
    double dsq = pow( xb - xa, 2.0 ) + pow( yb - ya, 2.0 );
    if( dsq > ra + rb ) {
      cout << 0 << endl;
      continue;
    }
//     b in a
    if( sqrt( dsq ) <= ra - rb ) {
      cout << 2 << endl;
      continue;
    }

//     a in b 
    if( sqrt( dsq ) <= rb - ra ) {
      cout << -2 << endl;
      continue;
    }

    cout << 1 << endl;
  }

  return EXIT_SUCCESS;
}