#include <bits/stdc++.h>
using namespace std;
namespace Solver {
long long P;
long long mul(long long a, long long b) {
  a %= P, b %= P;
  return (a * b - (long long)(((long double)a * b + 0.5) / P) * P + P) % P;
}
long long sum(long long a) {
  if (a <= 0) return 0;
  long long b = a + 1, c = 2 * a + 1;
  if (a % 2) {
    if (b % 3)
      return mul(a * c / 3 % P, b / 2);
    else
      return mul(a * b / 6 % P, c);
  } else {
    if (a % 3)
      return mul(b * c / 3 % P, a / 2);
    else
      return mul(a / 6 * b % P, c);
  }
}
long long solve(long long x, long long y) {
  if (!x || !y) return 0;
  long long t = min(x, y), res = 0;
  if (t % 2)
    res = mul((t * t + 1) / 2 % P, t * t % P);
  else
    res = mul(t / 2 * t % P, (t * t + 1) % P);
  if (x > y) {
    t = sum(x) - sum(y);
    if (t < 0) t += P;
    res = (res + mul(t, y) - mul(y * (y - 1) / 2 % P, (x - y))) % P;
    if (res < 0) res += P;
  }
  if (x < y) {
    t = sum(y - 1) - sum(x - 1);
    if (t < 0) t += P;
    res = (res + mul(t, x) + mul(x * (x + 1) / 2 % P, (y - x))) % P;
  }
  return res;
}
}  // namespace Solver
inline long long solve(long long x, long long y, long long P) {
  return Solver::P = P, Solver::solve(x, y);
}
int main() {
  int q0, xl, xr, yl, yr;
  for (scanf("%d", &q0); q0; q0--) {
    scanf("%d%d%d%d", &xl, &yl, &xr, &yr);
    long long res0 =
        solve(xr, yr, 10000000000ll) - solve(xl - 1, yr, 10000000000ll) -
        solve(xr, yl - 1, 10000000000ll) + solve(xl - 1, yl - 1, 10000000000ll);
    if (res0 >= 10000000000ll) res0 -= 10000000000ll;
    if (res0 >= 10000000000ll) res0 -= 10000000000ll;
    if (res0 < 0) res0 += 10000000000ll;
    if (res0 < 0) res0 += 10000000000ll;
    long long res1 =
        solve(xr, yr, 10000000001ll) - solve(xl - 1, yr, 10000000001ll) -
        solve(xr, yl - 1, 10000000001ll) + solve(xl - 1, yl - 1, 10000000001ll);
    if (res1 >= 10000000001ll) res1 -= 10000000001ll;
    if (res1 >= 10000000001ll) res1 -= 10000000001ll;
    if (res1 < 0) res1 += 10000000001ll;
    if (res1 < 0) res1 += 10000000001ll;
    if (res0 != res1)
      printf("...%010I64d\n", res0);
    else
      printf("%I64d\n", res0);
  }
  return 0;
}
