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

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