#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
int main()
{
	int n;
	cin >> n;
	while( n-- > 0){
		double xa,ya,ra,xb,yb,rb;
		cin >> xa >> xb >> ra >> xb >> yb >> rb;
		double ab = sqrt(pow(xb-xa, 2.0) + pow(yb-ya, 2.0));
		if(ab > ra+rb){ 
			cout << 0 << endl;
		}else if(ab >= abs(ra-rb) ){
			cout << 1 << endl;
		}else if(ra > rb){
			cout << 2 << endl;
		}else  {
			cout << -2 << endl;
		}
	}		
	return 0;
}