#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define rep2(i, n) for(int i = 1; i <= (int)n; ++i)
#define repit(it, t) for(__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++)

#define pb push_back
#define lb lower_bound
#define mp make_pair
#define ite iterator
#define ul unsigned long
#define ull unsigned long long
#define INF 1000000007
#define MOD 1000000007
#define EPS 1.0e-6
#define fs first
#define sd second

template<typename T>
bool elem(set<T> st, T val){
	return (st.find(val) != st.end());
}

template<typename T>
void printv(vector<T> vt){
    if(vt.size() == 0) return;
    rep(i, vt.size() - 1)
        cout << vt[i] << " ";
    cout << vt[vt.size() - 1] << endl;
}

typedef vector<int> vint;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef pair<int, int> pii;

double xa, ya, ra, xb, yb, rb;

#define db(x) ((x)*(x))

bool bina(){
    return (db(xa - xb) + db(ya - yb) < db(ra - rb));
}
    
int main(void){
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    while(t-- > 0){
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        if(bina()){
            cout << 2 << endl;
            continue;
        }
        swap(xa, xb);
        swap(ya, yb);
        swap(ra, rb);
        if(bina()){
            cout << -2 << endl;
            continue;
        }
        if(db(ra + rb) < db(xa - xb) + db(ya - yb))
            cout  << 0 << endl;
        else
            cout << 1 << endl;
    }
}