#include <bits/stdc++.h>
using namespace std;
inline int Get() {
  int res = 0, q = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * q;
}
const double eps = 1e-9, pi = M_PI;
const int oo = (int)2e9;
const long long INF = (long long)1e17;
int T;
int pr[11];
long long mod;
long long Mul(long long x, long long y) {
  return (x * y - (long long)((long double)x / mod * y + eps) * mod + mod) %
         mod;
}
long long Sum(long long x, int n) {
  if (n == 0)
    return x;
  else if (n == 1)
    return x * (x + 1) / 2;
  else if (n == 2)
    return Mul(x * (x + 1), 2 * x + 1) / 6;
  else
    return Mul(x * x, (x + 1) * (x + 1)) / 4;
}
long long Rec(long long l, long long r, long long n, int tp) {
  if (l > r) return 0;
  if (tp < 2 && !n) return 0;
  if (tp == 0) {
    return (Mul(2 * n, (Sum(r, 2) - Sum(l - 1, 2))) - Mul(r - l + 1, n * n) +
            (r - l + 1) * n) %
           mod;
  } else if (tp == 1) {
    return (Mul(2 * n, (Sum(r - 1, 2) - Sum(l - 2, 2))) +
            Mul(r - l + 1, n * n) + (r - l + 1) * n) %
           mod;
  } else if (tp == 2) {
    return (Mul(2, (Sum(r, 3) - Sum(l - 1, 3))) - (Sum(r, 2) - Sum(l - 1, 2)) +
            (Sum(r, 1) - Sum(l - 1, 1))) %
           mod;
  } else if (tp == 3) {
    return (Mul(2, (Sum(r, 3) - Sum(l - 1, 3))) -
            Mul(3, (Sum(r, 2) - Sum(l - 1, 2))) +
            Mul(3, (Sum(r, 1) - Sum(l - 1, 1)))) %
           mod;
  } else
    return ((Sum(r, 2) - Sum(l - 1, 2)) - (Sum(r, 1) - Sum(l - 1, 1)) +
            (Sum(r, 0) - Sum(l - 1, 0))) %
           mod;
}
long long Calc(int x1, int y1, int x2, int y2) {
  long long res = 0;
  if (x1 >= y2) {
    res = (Rec(x1, x2, y2, 0) - Rec(x1, x2, y1 - 1, 0)) % mod;
  } else if (x2 <= y1) {
    res = (Rec(y1, y2, x2, 1) - Rec(y1, y2, x1 - 1, 1)) % mod;
  } else if (x1 >= y1 && x2 >= y2) {
    res = (Rec(x1, y2, 0, 2) - Rec(x1, y2, y1 - 1, 0)) % mod;
    res = (res + Rec(y2 + 1, x2, y2, 0) - Rec(y2 + 1, x2, y1 - 1, 0)) % mod;
    res = (res + Rec(x1, y2, 0, 3) - Rec(x1, y2, x1 - 1, 1)) % mod;
    res = (res - Mul(2, Rec(x1, y2, 0, 4))) % mod;
  } else if (x1 >= y1 && x2 < y2) {
    res = (Rec(x1, x2, 0, 2) - Rec(x1, x2, y1 - 1, 0)) % mod;
    res = (res + Rec(x1, x2, 0, 3) - Rec(x1, x2, x1 - 1, 1)) % mod;
    res = (res + Rec(x2 + 1, y2, x2, 1) - Rec(x2 + 1, y2, x1 - 1, 1)) % mod;
    res = (res - Mul(2, Rec(x1, x2, 0, 4))) % mod;
  } else if (x1 < y1 && x2 >= y2) {
    res = (Rec(y1, y2, 0, 2) - Rec(y1, y2, y1 - 1, 0)) % mod;
    res = (res + Rec(y2 + 1, x2, y2, 0) - Rec(y2 + 1, x2, y1 - 1, 0)) % mod;
    res = (res + Rec(y1, y2, 0, 3) - Rec(y1, y2, x1 - 1, 1)) % mod;
    res = (res - Mul(2, Rec(y1, y2, 0, 4))) % mod;
  } else if (x1 < y1 && x2 < y2) {
    res = (Rec(y1, x2, 0, 2) - Rec(y1, x2, y1 - 1, 0)) % mod;
    res = (res + Rec(y1, x2, 0, 3) - Rec(y1, x2, x1 - 1, 1)) % mod;
    res = (res + Rec(x2 + 1, y2, x2, 1) - Rec(x2 + 1, y2, x1 - 1, 1)) % mod;
    res = (res - Mul(2, Rec(y1, x2, 0, 4))) % mod;
  }
  if (res < 0) res += mod;
  return res >> 1;
}
int main() {
  for (scanf("%d"
             "\n",
             &T);
       T--;) {
    int x1, x2, y1, y2;
    scanf(
        "%d"
        "%d"
        "%d"
        "%d"
        "\n",
        &x1, &y1, &x2, &y2);
    mod = 1.2e17;
    long long ans1 = Calc(x1, y1, x2, y2);
    mod = 1.2e18;
    long long ans2 = Calc(x1, y1, x2, y2);
    if (ans1 != ans2 || ans1 > (long long)1e10) {
      printf("...");
      for (int i = (1), end = (10); i <= end; ++i)
        pr[i] = (int)(ans1 % 10), ans1 /= 10;
      for (int i = (10), end = (1); i >= end; --i) printf("%d", pr[i]);
      printf("\n");
    } else
      printf(
          "%I64d"
          "\n",
          ans1);
  }
  return 0;
}
