#include <cstdio>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <functional>
#include <complex>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
const double PI = 3.141592653589793238462643383279502884L;
const int LARGE_PRIME = 1000000007;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repfn(i,a,cont,next) \
  for(auto i = (a); [=](){return(cont);}(); i = [=](){return(next);}())
#define repby(i,a,b,s) repfn(i,a,i<b,i+s)
#define repab(i,a,b) repby(i,a,b,1)
#define rep(i,b) repab(i,0,b)
#define pb push_back
#define sz(c) int((c).size())

typedef complex<double> P;

int main(int argc, char **argv)
{
  int N, a=0, b=1;
  vector<double> x(2), y(2), r(2);
  cin >> N;
  while (N--) {
    for (auto i:{a, b}) {
      cin >> x[i] >> y[i] >> r[i];
    }

    P A(x[a], y[a]), B(x[b], y[b]);

    double d = abs(A - B);
    if (d <= r[a] + r[b]) {
      if (d + r[a] <= r[b]) {
        cout << -2;
      } else if (d + r[b] <= r[a]) {
        cout << 2;
      } else {
        cout << 1;
      }
    } else {
      cout << 0;
    }
    cout << endl;
  }
  return 0;
}