#include<bits/stdc++.h>
#define E 0.000000001
using namespace std;
int main(){
  int n;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    double s=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)),r=ra+rb;
    if(s>r)cout<<"0"<<endl;
    else if(s+rb<ra) cout<<"2"<<endl;
    else if(s+ra<rb) cout<<"-2"<<endl;
    else cout<<"1"<<endl;
  }
  return 0;
}