#include <iostream>
#include <cmath>
using namespace std;

int main() {
  int n;
  double xa, ya, ra, xb, yb, rb;

  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> xa >> ya >> ra >> xb >> yb;
    double d = sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));

    int ans;
    if(d+ra < rb) ans = -2;
    else if(d+rb < ra) ans = 2;
    else if(d > ra+rb) ans = 0;
    else ans = 1;

    cout << ans << endl;
  }
}
    