#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

double distance( double y1, double x1, double y2, double x2){
  return sqrt( (y1 - y2) * (y1 - y2) + (x1 - x2) * (x1 - x2));
}
int main(){
  int q;
  cin >> q;
  while(q--){
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = distance( ya, xa, yb, xb);

    int ret = 0;
    if( d < ra - rb) ret = 2;
    else if( d < rb - ra) ret = -2;
    else if( d == ra + rb || d == ra - rb) ret = 1;

    cout << ret << endl;
  }
}