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

int main(){
  int n,cnt=0;
  double xa,ya,ra,xb,yb,rb;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xa>>ya>>ra>>xb>>yb>>rb;
    if(xa+1*ra>=xb+1*rb) cnt++;
    if(ya+1*ra>=yb+1*rb) cnt++;
    if(xa+-1*ra<=xb+-1*rb) cnt++;
    if(ya+-1*ra<=yb+-1*rb) cnt++;
 


    if(xa+1*ra<xb-1*rb || ya+1*ra<yb-1*rb) cout<<0<<endl;
    else if(xa-1*ra>xb+1*rb || ya-1*ra>yb+1*rb) cout<<0<<endl;
    else if(cnt==4) cout<<2<<endl;
    else if(cnt==0) cout<<-2<<endl;
    else cout<<1<<endl;
  }
  return 0;
}