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) {
            writeln(0);
        }else if (d < (ar-br)^^2) {
            if (br < ar) {
                writeln(2);
            } else {
                writeln(-2);
            }
        } else {
            writeln(1);
        }
    }
}

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