#include <bits/stdc++.h>
using namespace std;


int main(){
  int n;
  cin >> n;

  for(int i=0; i<n; i++){
    double x1, y1, x2, y2, r1, r2;
    cin >> x1 >> y1 >> r1 >> x2 >>y2 >> r2;

    double d = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));

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