#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#include <bits/stdc++.h>
using namespace std;
  

int main() {
  int n;
  cin>>n;
  
  double xa,ya,ra,xb,yb,rb;
  double D,R1,R2;
  rep(i,n){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    
    D=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
    R1=(ra+rb)*(ra+rb);
    R2=(ra-rb)*(ra-rb);
    
    if(D>R1) cout<<0<<endl;
    else if(D>=R2 && D<=R1) cout<<1<<endl;
    else{
      if(ra>rb) cout<<2<<endl;
      else cout<<-2<<endl;
    }
  }
  
  return 0;
}
