#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio( false );

	int n;
	cin >> n;

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

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

		int result = 0;
		if( d <= ra+rb ) {
			result = 1;

			if( d+ra < rb ) { result = -2; }
			if( d+rb < ra ) { result = 2; }
		}

		cout << result << endl;
	}
}

