#include<iostream>
#include<cmath>
using namespace std;
int main(){
  float x1, y1, r1, x2, y2, r2;
  int n, ans;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    float r = r1 + r2;
    float d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));

    if(d > r) ans = 0;
    else if(r1 > r2) {
      if(d + r2 < r1) ans = 2;
      else ans = 1;
    }
    else if(r1 < r2) {
      if(d + r1 < r2) ans = -2;
      else ans = 1;
    }
    else if(r1 = r2){
      ans = 1;
    }
    cout << ans << endl;
  }
    
}