#include <bits/stdc++.h>
using namespace std;
unsigned long long mod0 = 10000000000LL, mod1 = 10000000001LL, mod;
unsigned long long sum1(unsigned long long a, unsigned long long b) {
  unsigned long long v = b, w = b + 1, x = a, y = (a == 0) ? 0 : (a - 1);
  if (v % 2 == 0)
    v /= 2;
  else
    w /= 2;
  if (x % 2 == 0)
    x /= 2;
  else
    y /= 2;
  long long ret = (v * w + (mod - x) * y) % mod;
  return ret % mod;
}
unsigned long long sum2(unsigned long long a, unsigned long long b) {
  unsigned long long v = b, w = b + 1, u = 2 * b + 1, p = a,
                     r = (a == 0) ? 0 : (a - 1), s = (a == 0) ? 0 : (2 * a - 1);
  if (v % 2 == 0)
    v /= 2;
  else
    w /= 2;
  if (p % 2 == 0)
    p /= 2;
  else
    r /= 2;
  if (v % 3 == 0)
    v /= 3;
  else if (w % 3 == 0)
    w /= 3;
  else
    u /= 3;
  if (p % 3 == 0)
    p /= 3;
  else if (r % 3 == 0)
    r /= 3;
  else
    s /= 3;
  unsigned long long l =
      ((v * u) % mod * w) % mod + mod - ((p * s) % mod * r) % mod;
  return l % mod;
}
unsigned long long sumUp(unsigned long long x1, unsigned long long x2,
                         unsigned long long y1, unsigned long long y2) {
  unsigned long long ret = ((1 + x2 - x1) * sum2(y1, y2)) % mod;
  unsigned long long v = y2 + 1 - y1,
                     w = x2 * x2 + 2 + 3 * x2 + 2 * mod - x1 - x1 * x1;
  if (v % 2 == 0)
    v /= 2;
  else
    w /= 2;
  w %= mod;
  v %= mod;
  return (ret + v * w) % mod;
}
unsigned long long sumDn(unsigned long long x1, unsigned long long x2,
                         unsigned long long y1, unsigned long long y2) {
  unsigned long long ret = ((1 + y2 - y1) * sum2(x1 + 1, x2 + 1)) % mod;
  unsigned long long v = 1 + x2 - x1, w = y1 + y2, u = y2 + 1 - y1;
  if (v % 2 == 0)
    v /= 2;
  else if (w % 2 == 0)
    w /= 2;
  else
    u /= 2;
  w = (w * u) % mod;
  return (ret + v * (mod - w)) % mod;
}
unsigned long long sumUhl(unsigned long long a, unsigned long long b) {
  unsigned long long v = ((b + 1) * (b + 1) + 1), u = b + 1, w = (a * a + 1),
                     p = a;
  if (v % 2 == 0)
    v /= 2;
  else
    u /= 2;
  if (w % 2 == 0)
    w /= 2;
  else
    p /= 2;
  v %= mod;
  w %= mod;
  unsigned long long ret =
      ((v * u) % mod * (b + 1)) % mod + mod - ((w * p) % mod * a) % mod;
  return (ret + 2 * mod - sumUp(0, a - 1, a, b) - sumDn(a, b, 0, a - 1)) % mod;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    unsigned long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--, y1--, x2--, y2--;
    if (x2 <= y1) {
      mod = mod0;
      unsigned long long ans = sumUp(x1, x2, y1, y2) % mod;
      mod = mod1;
      unsigned long long ans2 = sumUp(x1, x2, y1, y2) % mod;
      if (ans != ans2) {
        cout << "...";
        int p = 0;
        ans2 = ans;
        while (ans2 > 0) {
          p++;
          ans2 /= 10;
        }
        for (int j = 0; j < 10 - p; j++) cout << "0";
      }
      cout << ans << "\n";
      continue;
    }
    if (y2 <= x1) {
      mod = mod0;
      unsigned long long ans = sumDn(x1, x2, y1, y2) % mod;
      mod = mod1;
      unsigned long long ans2 = sumDn(x1, x2, y1, y2) % mod;
      if (ans != ans2) {
        cout << "...";
        int p = 0;
        ans2 = ans;
        while (ans2 > 0) {
          p++;
          ans2 /= 10;
        }
        for (int j = 0; j < 10 - p; j++) cout << "0";
      }
      cout << ans << "\n";
      continue;
    }
    mod = mod0;
    unsigned long long ans = 0;
    unsigned long long x01 = x1, x02 = x2, y01 = y1, y02 = y2;
    if (y2 > x2) {
      ans += sumUp(x1, x2, x2 + 1, y2);
      y2 = x2;
    } else if (y2 < x2) {
      ans += sumDn(y2 + 1, x2, y1, y2);
      x2 = y2;
    }
    if (y1 < x1) {
      ans += sumDn(x1, x2, y1, x1 - 1);
      y1 = x1;
    } else if (y1 > x1) {
      ans += sumUp(x1, y1 - 1, y1, y2);
      x1 = y1;
    }
    ans += sumUhl(x1, x2);
    ans %= mod;
    mod = mod1;
    unsigned long long ans2 = 0;
    x1 = x01, x2 = x02, y1 = y01, y2 = y02;
    if (y2 > x2) {
      ans2 += sumUp(x1, x2, x2 + 1, y2);
      y2 = x2;
    } else if (y2 < x2) {
      ans2 += sumDn(y2 + 1, x2, y1, y2);
      x2 = y2;
    }
    if (y1 < x1) {
      ans2 += sumDn(x1, x2, y1, x1 - 1);
      y1 = x1;
    } else if (y1 > x1) {
      ans2 += sumUp(x1, y1 - 1, y1, y2);
      x1 = y1;
    }
    ans2 += sumUhl(x1, x2);
    ans2 %= mod;
    if (ans != ans2) {
      cout << "...";
      int p = 0;
      ans2 = ans;
      while (ans2 > 0) {
        p++;
        ans2 /= 10;
      }
      for (int j = 0; j < 10 - p; j++) cout << "0";
    }
    cout << ans << "\n";
  }
  return 0;
}
