#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    double o[2][3],d;
    for(int i=0; i<2; i++) for(int j=0; j<3; j++) cin >>o[i][j];
    d = sqrt((o[1][0]-o[0][0])*(o[1][0]-o[0][0])+(o[1][1]-o[0][1])*(o[1][1]-o[0][1]));
    if(o[0][2]+o[1][2]<d) cout <<"0"<<endl;
    else if(o[0][2]>o[1][2]){
      if(o[0][2]-o[1][2] > d) cout <<"2"<<endl;
      else cout <<"1"<<endl;
    }
    else{
      if(o[1][2]-o[0][2] > d) cout <<"-2"<<endl;
      else cout <<"1"<<endl;
    }
  }
  return 0;
}