import std.stdio, std.math, std.conv, std.array, std.string, std.algorithm;

void main() {
    uint c = to!uint(readln().chomp);
    for (uint i = 0; i < c; ++i) {
        double[] dx = map!(to!double)(readln().chomp.split).array;
        double[] ap = dx[0..2];
        double[] bp = dx[3..5];
        double ar = dx[2];
        double br = dx[5];
        double d = dist(ap, bp);
        if (d < (ar-br)^^2) {
            if (br < ar) {
                writeln(2);
            } else {
                writeln(-2);
            }
        } else if (d - (ar+br)^^2 < 1.0e-10) {
            writeln(1);
        } else {
            writeln(0);   
        }
    }
}

double dist(double[] ax, double[] bx) {
    return (ax[0]-bx[0])^^2 + (ax[1]-bx[1])^^2;
}