#include <iostream>
#include <cmath>

using namespace std;

int main() {
  
  int N; cin >> N;
  double xa, ya, xb, yb, ra, rb;
  while(N--) {
    cin >> xa >> ya >> ra;
    cin >> xb >> yb >> rb;
    double dist2 = pow(xb-xa, 2) + pow(yb-ya, 2);
    
    if(dist2 < pow(ra-rb, 2) && rb < ra) {
      cout << 2 << endl;
    }
    else if(dist2 < pow(ra-rb, 2) && ra < rb) {
      cout << -2 << endl;
    }
    else if(pow(ra+rb, 2) < dist2) {
      cout << 0 << endl;
    }
    else {
      cout << 1 << endl;
    }
  }
  return 0;
}