#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

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