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