#include <iostream>
#include <math.h>
using namespace std;
struct circle{
  double x;
  double y;
  double r;
};
  int inclusion(circle,circle);
int main(){
  int n;
  circle a,b;
  cin >> n;
  for(;n;n--){
    cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
    cout<<inclusion(a,b)<<endl;
  }
  return 0;
}

int inclusion(circle a,circle b){
  double distance = sqrt( pow(b.x-a.x,2)+pow(b.y-a.y,2));
  circle d;
  int abs;
  if(a.r>b.r)abs=1;
  else
    abs=-1,d=a,a=b,b=d;
  if(distance<=a.r+b.r){
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つキツ。
    if(distance<a.r){
      return 2*abs;
    }
    else{
      return 1;
    }
  }
  else{
    //ツ陛ッツ甘慊つオツづつ「ツづ慊つケツづアツ。
    return 0;
  }
}
/*
Sample Input
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 2.0 4.1 0.0 2.0
Output for the Sample Input
2
0
*/