#include <bits/stdc++.h>
using namespace std;
inline long long multi(long long x, long long y, long long m) {
  x %= 10000000000LL, y %= 10000000000LL;
  return (x * y - (long long)(x / (long double)m * y + 1e-5) * m + m) % m;
}
inline long long mul(long long a, long long b) {
  if (a & 1)
    b >>= 1;
  else
    a >>= 1;
  return multi(a, b, 10000000000LL);
}
inline long long square(int x) {
  long long N = (long long)x * x;
  return mul(N, N + 1);
}
inline long long mul(long long a, long long b, long long c) {
  if (a % 3 == 0)
    a /= 3;
  else if (b % 3 == 0)
    b /= 3;
  else
    c /= 3;
  if (~a & 1)
    a >>= 1;
  else if (~b & 1)
    b >>= 1;
  else
    c >>= 1;
  return multi(multi(a, b, 10000000000LL), c, 10000000000LL);
}
inline long long tetragon(int x, int y) {
  return multi(x,
               (mul(y - 1, y, 2 * y - 1) - mul(x - 1, x, 2 * x - 1) +
                10000000000LL) %
                   10000000000LL,
               10000000000LL) +
         multi(mul(x, x + 1), y - x, 10000000000LL);
}
inline long long nogartet(int x, int y) {
  return multi(y,
               (mul(x, x + 1, 2 * x + 1) - mul(y, y + 1, 2 * y + 1) +
                10000000000LL) %
                   10000000000LL,
               10000000000LL) +
         multi(mul(y, y - 1), y - x + 10000000000LL, 10000000000LL);
}
inline long long calc(int x, int y) {
  if (x && y) {
    long long ans = square(min(x, y));
    if (x < y) ans += tetragon(x, y);
    if (x > y) ans += nogartet(x, y);
    return ans;
  } else
    return 0;
}
inline long double Square(int x) {
  long double N = (long double)x * x;
  return N * (N + 1) / 2;
}
inline long double Tetragon(int x, int y) {
  return x * ((y - 1) / 6. * y * (2 * y - 1) - (x - 1) / 6. * x * (2 * x - 1)) +
         (long double)x * (x + 1) / 2 * (y - x);
}
inline long double Nogartet(int x, int y) {
  return y * (x / 6. * (x + 1) * (2 * x + 1) - y / 6. * (y + 1) * (2 * y + 1)) +
         (long double)y * (y - 1) / 2 * (y - x);
}
inline long double Calc(int x, int y) {
  if (x && y) {
    long double ans = Square(min(x, y));
    if (x < y) ans += Tetragon(x, y);
    if (x > y) ans += Nogartet(x, y);
    return ans;
  } else
    return 0;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    long long ans = calc(x2, y2) - calc(x1 - 1, y2) - calc(x2, y1 - 1) +
                    calc(x1 - 1, y1 - 1);
    ans %= 10000000000LL;
    if (ans < 0) ans += 10000000000LL;
    long double sum = Calc(x2, y2) - Calc(x1 - 1, y2) - Calc(x2, y1 - 1) +
                      Calc(x1 - 1, y1 - 1);
    if (sum < 10000000000LL)
      printf("%I64d\n", ans);
    else
      printf("...%010I64d\n", ans);
  }
}
