#include <iostream> 
#include <cmath> 
#include <string> 
#include <vector>
   
 using namespace std; 
  int main() { 
    int n; 
    cin >> n; 
    for (int i = 0; i < n; i++) { 
        double ax,ay,ar,bx,by,br; 
        cin >> ax >> ay >> ar >> bx >> by >> br; 
        double dis_x = abs(ax-bx);
        double dis_y = abs(ay-by); 
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
        if ( dist > ar + br )
             cout << 0;  } 
else if ( dist + ar < br ) { 
             cout << -2;  }
 else if ( dist + br < ar ) { 
             cout << 2;  } 
else 
             cout << 1<< endl; 
     }
    return 0; 
 }