#include<iostream>
#include<complex>
using namespace std;
#define dff 1e-10
int main(){
  int n;
  cin >>n;
  while(n--){
    complex<double> a,b;
    double ar,br,dr;
    cin >>a.real()>>a.imag()>>ar>>b.real()>>b.imag()>>br;
    dr = abs(a-b);
    if(dr-ar-br>dff) cout <<"0"<<endl;
    else if(ar>br && dr-ar+br < -dff) cout <<"2"<<endl;
    else if(br>ar && dr-br+ar < -dff) cout <<"-2"<<endl;
    else cout <<"1"<<endl;
  }
  return 0;
}