#include <iostream>

using namespace std;


int main()
{
  int i;
  cin>>i;
  for(;i--;)
    {

      double xa,ya,ra,xb,yb,rb;     
      int ans;
      cin>>xa>>ya>>ra>>xb>>yb>>rb;
      if((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)>(ra+rb)*(ra+rb))
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;	
	  else
	    ans = 0;
	}
      else
	{
	  if(xa < xb+rb && xa>xb-rb && ya < yb+rb && ya>yb-rb && ra > rb)
	    ans =2;
	  else if (xb < xa+ra && xb>xa-rb && yb < ya+rb && yb>ya-rb && rb > ra)
	    ans =-2;
	  else
	    ans =-1;
	}

      cout<<ans<<endl;

    }

}