#include<iostream>
using namespace std;
int main(){
  int c;
  double ax,ay,ar,bx,by,br;
  cin>>c;
  for(int i=0;i<c;i++){
    cin>>ax>>ay>>ar>>bx>>by>>br;
    if((ax+ar>bx+br&&ax-ar<bx-br) && (ay+ar>by+br&&ay-ar<by-br))
      cout<<"2";
    else if((bx+br>ax+ar&&bx-br<ax-ar) && (by+br>ay+ar&&by-br<ay-ar))
      cout<<"-2";
    else if((bx+br>ax+ar||bx-br<ax-ar) || (by+br>ay+ar||by-br<ay-ar))
      cout<<"1";
    else cout<<"0";
    cout<<endl;
  }
}