/**************************************************************************************************************
   *  Md. Abdulla Al Mamun (Nayon)
   *  ID: 1306001
   *  Session: 2013-2014
   *  Department of Computer Science and Engineering
   *  Begum Rokeya University, Rangpur (BRUR)
***************************************************************************************************************/
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <ios>
#include <set>
#include <map>

using namespace std;

#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1 << 28
#define sq(a) ((a) * (a))
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(a, b) make_pair(a, b)
#define endl '\n'
#define MAX 100000
#define MOD 1000000007
#define dprint(expr) printf(#expr " = %lf\n", expr)

inline bool isEq(double a, double b){return (abs(a-b) < EPS);}
inline double NegZero(double x){if(isEq(x, -0.0))return +0.0;else return x;}

typedef long long ll;
typedef pair<int, int> pii;

//#define isValid(a, b) ((a >= 0 && a < b) ? 1 : 0)
//int dr[]  =  {0, -1, -1, -1,  0,  1, 1, 1};
//int dc[]  =  {1,  1,  0, -1, -1, -1, 0, 1};

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios_base::sync_with_stdio(false); cin.tie(NULL);
    double xa, ya, ra, xb, yb, rb;
    int t;
    cin >> t;
    while(t--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		int d = sqrt(sq(xa-xb) + sq(ya-yb));
		if(max(ra,rb) >= d+min(ra,rb)){
			if(ra >= rb)
				cout << "2" << endl;
			else if(rb > ra)
				cout << "-2" << endl;
			/*else
				cout << "1" << endl;*/
		}
		else if(d <= ra+rb)
			cout << "1\n";
		else
			cout << "0" << endl;
    }
    return 0;
}