#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int n;

    cin >> n;

    for(int i=1; i<=n; i++){
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));

        if(ra + rb < d){
            cout << "0";
        }else if(ra + d < rb){
            cout << "-2";
        }else if(rb + d < ra){
            cout << "2";
        }else{
            cout << "1";
        }
    }

    return 0;
}