#include <bits/stdc++.h>
using namespace std;
struct huge {
  long long p[11];
  int l;
  huge() {
    memset(p, 0, sizeof(p));
    l = 0;
  }
  inline void init() {
    memset(p, 0, sizeof(p));
    l = 0;
  }
  friend inline huge operator+(const huge &a, const huge &b) {
    huge c;
    c.l = a.l;
    if (b.l > c.l) c.l = b.l;
    for (int i = 1; i <= c.l; i++) c.p[i] = a.p[i] + b.p[i];
    for (int i = 1; i <= c.l; i++)
      if (c.p[i] >= 100000) c.p[i + 1] += c.p[i] / 100000, c.p[i] %= 100000;
    if (c.p[c.l + 1]) c.l++;
    return c;
  }
  friend inline huge operator-(huge c, const huge &b) {
    for (int i = 1; i <= b.l; i++) {
      if (c.p[i] >= b.p[i]) {
        c.p[i] -= b.p[i];
        continue;
      }
      int j = i + 1;
      while (c.p[j] == 0) j++;
      c.p[j]--;
      for (int k = i + 1; k < j; k++) c.p[k] = 100000 - 1;
      c.p[i] = c.p[i] + 100000 - b.p[i];
    }
    while (!c.p[c.l] && c.l) c.l--;
    return c;
  }
  friend inline huge operator*(const huge &a, const huge &b) {
    huge c;
    if (a.l < 2 && !a.p[1] || b.l < 2 && !b.p[1]) return c;
    c.l = a.l + b.l - 1;
    for (int i = 1; i <= a.l; i++)
      for (int j = 1; j <= b.l; j++) c.p[i + j - 1] += a.p[i] * b.p[j];
    for (int i = 1; i <= c.l; i++)
      if (c.p[i] >= 100000) c.p[i + 1] += c.p[i] / 100000, c.p[i] %= 100000;
    while (c.p[c.l + 1])
      c.l++, c.p[c.l + 1] += c.p[c.l] / 100000, c.p[c.l] %= 100000;
    return c;
  }
  inline void DIV(huge &c, long long k) {
    long long x = 0;
    for (int i = c.l; i; i--) {
      long long res = x * 100000 + c.p[i];
      c.p[i] = res / k;
      x = res % k;
    }
  }
} a, b, K, ans, add;
inline huge change(long long x) {
  huge a;
  for (; x; x /= 100000) a.p[++a.l] = x % 100000;
  return a;
}
inline huge TH(long long x) {
  huge a = change(x), b = change(x + 1), c = change(x * 2 + 1), d = a * b * c;
  d.DIV(d, 6);
  return d;
}
inline huge calc(int x, int y) {
  huge ans;
  if (!x || !y) return ans;
  int k = (x < y) ? x : y;
  a = change(k * 1ll * k), b = change(k * 1ll * k + 1);
  ans = a * b;
  ans.DIV(ans, 2);
  K = change(k);
  if (x > k) {
    add = K * change(k - 1) * change(x - k);
    add.DIV(add, 2);
    ans = ans + (TH(x) - TH(k)) * K - add;
  }
  if (y > k) {
    add = K * change(k + 1) * change(y - k);
    add.DIV(add, 2);
    ans = ans + add + (TH(y - 1) - TH(k - 1)) * K;
  }
  return ans;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    ans = calc(x2, y2);
    ans = ans + calc(x1 - 1, y1 - 1);
    ans = ans - calc(x2, y1 - 1) - calc(x1 - 1, y2);
    if (ans.l > 2)
      printf("...%05I64d%05I64d", ans.p[2], ans.p[1]);
    else if (ans.p[2])
      printf("%I64d%05I64d", ans.p[2], ans.p[1]);
    else
      printf("%I64d", ans.p[1]);
    puts("");
  }
  return 0;
}
