#include <iostream>
#include <cmath>
using namespace std;
#define PI 3.14
int main(void)
{
  double xa,ya,ra,xb,yb,rb;
  double areaa,areab;
  double len;
  int n;
  
  cin >> n;
  for(int i = n ; i > 0 ; i--){
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    
    areaa = ra * ra * PI;
    areab = rb * rb * PI;

    len = abs(xa - xb) * abs(xa - xb) + abs(ya - yb) * abs(ya - yb);
    len = sqrt(len);

    if(len > ra + rb) cout << 0 << endl;
    else if(ra + rb > len && len > ra - rb) cout << 1 << endl;
    else if(len < ra - rb && areaa >= areab) cout << 2 << endl;
    else if(len < ra - rb && areab >= areaa) cout << -2 << endl;
  }
  return 0;
}