#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  int n;
  cin >> n;
  REP(i, n) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    //cout << xa << " " << ya << " " << ra << " " << xb << " " << yb << " " << rb << endl;
    if(abs(ra-rb) <= d && d <= ra+rb) cout << 1 << endl;
    else if(ra+rb < d) cout << 0 << endl;
    else if(ra > rb && d < ra-rb) cout << 2 << endl;
    else if(rb > ra && d < rb-ra) cout << -2 << endl;
    else assert(false);
  }

  return 0;
}