#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    double xa, ya, ra, xb, yb, rb, d;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    d = hypot(xa - xb, ya - yb);
    if (d > ra + rb)
      cout << 0;
    else if (d + rb < ra)
      cout << 2;
    else if (d + ra < rb)
      cout << -2;
    else
      cout << 1;
    cout << "\n";
  }
}

