#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        double x, y, r, X, Y, R;
        cin >> x >> y >> r >> X >> Y >> R;
        double d = sqrt((X-x) * (X - x) + (Y - y) * (Y - y));
        if (r >= d + R) {
            cout << 2 << endl;
        } else if (R >= d + r) {
            cout << -2 << endl;
        } else if (r - R <= d && d <= r + R) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}