#include <iostream>
using namespace std;

int main() {

  long long int n;

  cin >> n;

  double xa, ya, ra, xb, yb, rb;

  for ( long long int i = 0; i < n; i++ ) {

    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    double x = xa - xb;
    x *= x;
    double y = ya - yb;
    y *= y;
    double r = ra - rb;
    r *= r;
    if ( r > x + y ) {
      if ( ra > rb ) {
	cout << 2 << endl;
      }else {
	cout << -2 << endl;
      }
    }else {
      if ( x + y > ( ra + rb ) * ( ra + rb ) ) {
	cout << 0 << endl;
      }else {
	cout << 1 << endl;
      }
    }

  }

  return 0;

}