#include <bits/stdc++.h>
long long MOD = 1e10;
inline long long mul(long long x, long long y) {
  x %= MOD;
  y %= MOD;
  if (y < 0) y += MOD;
  if (x < 0) x += MOD;
  if (fabs(x * 1.0 * y) <= 9223372036854775800.0) return x * y % MOD;
  long long res = 0;
  for (; y; y /= 2) {
    if (y & 1) {
      res += x;
      if (res > 1223372036854775807LL) res %= MOD;
    }
    x <<= 1;
    if (x > 1223372036854775807LL) x %= MOD;
  }
  return res % MOD;
}
inline long long S(long long l, long long r) {
  if ((r - l + 1) & 1)
    return mul((r - l + 1), (l + r) / 2);
  else
    return mul((r - l + 1) / 2, (l + r));
}
inline long long S2(long long n) {
  long long k1 = n * (n + 1) / 2, k2 = 2 * n + 1;
  if (k1 % 3 == 0)
    k1 /= 3;
  else
    k2 /= 3;
  return mul(k1, k2);
}
inline long long sum(int x, int y) {
  if (!x || !y) return 0;
  long long Min = std::min(x, y);
  Min *= Min;
  long long res = S(1, Min);
  if (x < y) {
    long long z = S(Min + 1, Min + x), tmp = S(1, y - x - 1);
    res =
        (res + mul(z, (y - x)) + mul(mul(tmp, 2 * x) + S2(y - x - 1), x)) % MOD;
  } else if (x > y) {
    Min += y + 1;
    std::swap(x, y);
    long long z = S(Min + 1, Min + x), tmp = S(1, y - x - 1);
    res = (res + mul(z, (y - x)) +
           mul(mul(tmp, 2 * (x + 1)) + S2(y - x - 1), x)) %
          MOD;
  }
  return res;
}
int main() {
  int t = 0;
  scanf("%d", &t);
  for (int x1, x2, y1, y2; t--;) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    --x1;
    --y1;
    long long ans1 =
        ((sum(x2, y2) + sum(x1, y1) - sum(x2, y1) - sum(x1, y2)) % MOD + MOD) %
        MOD;
    ++MOD;
    long long ans2 =
        ((sum(x2, y2) + sum(x1, y1) - sum(x2, y1) - sum(x1, y2)) % MOD + MOD) %
        MOD;
    --MOD;
    if (ans1 == ans2)
      printf("%I64d\n", ans1);
    else
      printf("...%010I64d\n", ans1);
  }
}
