#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    int n;
    cin >> n;
    REP(i, n){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dist;
        dist = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
        if (dist > ra + rb) cout << "0" << endl;
        else {
            if (ra > rb){
                if (dist+rb < ra) cout << "2" << endl;
                else cout << "1" << endl;
            } else {
                if (dist+ra < rb) cout << "-2" << endl;
                else cout << "1" << endl;
            }
        }
    }
}
