#include <iostream>
#include <cmath>
using namespace std;
int main(){
  double xa,ya,ra,xb,yb,rb;
  int n;
  cin >> n;
  while(n--){
    cin >>  xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt(pow(xa - xb,2) + pow(ya - yb,2));
    if(d>ra+rb)cout<<0<<endl;
    else if(ra-rb>d)cout<<2<<endl;
    else if(rb-ra>d)cout<<-2<<endl;
    else cout<<1<<endl;

  }
  return 0;
}