#include <iostream>
#include <cmath>
#include <cstdio>
#include <complex>

using namespace std;

typedef complex<double> P;

int main(void){
  int n; cin >> n;
  while(n--){
    double ra, rb;
    P a,b;
    cin  >> a.real() >> a.imag() >> ra >> b.real() >> b.imag() >> rb;
    double d = abs(a-b);
    int ans;
    if(0){}
    else if(d + rb < ra) ans = 2;
    else if(d + ra < rb) ans = -2;
    else if(d > ra + rb) ans = 0;
    else ans = 1;
    cout << ans << endl;
  }
  return 0;
}