#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
  int n; cin >> n;
  while(n--) {
    double xa,ya,ra,xb,yb,rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double dist = sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya));
    int ans;
    if(ra > dist + rb)
      ans = 2;
    else if(rb > dist + ra)
      ans = -2;
    else if(ra + rb < dist)
      ans = 0;
    else
      ans = 1;
    cout << ans << endl;
  }
}