#include<iostream>
#include<cmath>
#define EPS 0.00000001
using namespace std;

double eq(double x,double y){
  double z=abs(x-y);
  return z<EPS;
}
double di(double x1,double y1,double x2,double y2){
  return sqrt(pow(x1-x2,2.0)+pow(y1-y2,2.0));
}


int n;
double xa,ya,ra,xb,yb,rb;

int main(){
  cin>>n;
  while(n--){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if     (di(xa,ya,xb,yb)+rb<ra)cout<<2<<endl;
    else if(di(xa,ya,xb,yb)+ra<rb)cout<<-2<<endl;
    else if(di(xa,ya,xb,yb)<=ra+rb)cout<<1<<endl;
    else cout<<0<<endl;
  }
  return 0;
}