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

int intersect_circle(double xa, double ya, double ra, double xb, double yb, double rb){
    double dsq = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
    double rs = (ra + rb) * (ra + rb);
    double rd = (ra - rb) * (ra - rb);
    if(dsq > rs)return 0;
    else if(dsq <= rs && dsq >= rd)return 1;
    else if(ra > rb)return 2;
    else return -2;
}

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;++i){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        cout << intersect_circle(xa, ya, ra, xb, yb, rb) << endl;
    }

    return 0;
}
