#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n,i;
  double xa,ya,ra,xb,yb,rb;
  double dist;

  cin>>n;
  rep(i,n){

    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    dist=sqrt( (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) );

    if(dist>ra+rb)
      cout<<"0"<<endl;
    else if(rb<dist || ra<dist || ra==rb)
      cout<<"1"<<endl;
    else if(rb<ra)
      cout<<"2"<<endl;
    else if(ra<rb)
      cout<<"-2"<<endl;
  }
}