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

int solve(double xa, double ya, double ra, double xb, double yb, double rb){
    double distance = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
    if (distance > ra + rb) return 0;
    else if (distance < ra - rb) return 2;
    else if (distance < rb - ra) return -2;
    else return 1;
}

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