#include <iostream>
#include <cmath>
using namespace std;

int main(){
  double x1,y1,r1,x2,y2,r2,ans;
  int n;
  cin >> n;
  while(n--){
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    double len = sqrt(pow(x1-x2,2) + pow(y1-y2,2));
    if( len + r2 < r1){
      ans = 2;
    } else if(len + r1 < r2){
      ans = -2;
    } else if(len <= r1 + r2){
      ans = 1;
    } else {
      ans = 0;
    }
    cout << ans << endl;
  }
}