#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    double xa, ya, ra, xb, yb, rb, d;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    complex<double> c1(xa, ya), c2(xb, yb);
    d = abs(c1 - c2);
    cout << ((d > ra + rb) ? 0 : (d >= abs(ra - rb)) ? 1 : (ra > rb) ? 2 : -2) << endl;
  }
}