#include<iostream>
#include<cmath>
using namespace std;
int main(){
  double n,xa,ya,ra,xb,yb,rb,d,X,Y;
  cin >> n ;
  for(int i=0;i<n;i++){
  cin >> xa >> ya >> ra >> xb >> yb >> rb ;
  X=(xa-xb)*(xa-xb);
  Y=(ya-yb)*(ya-yb);
  d=sqrt(X+Y);

  if(d <ra-rb){
    cout << 2<< endl;}
  else if(d <rb-ra){
    cout << -2 << endl;}
  else if(d <ra+rb && (d>rb-ra || d >ra-rb) ){
    cout << 1 << endl;}
  else if(d > ra+rb){
    cout << 0 <<endl;}
  
  }

  return 0;
}