#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
template <typename X>
inline bool minimize(X& p, X q) {
  if (p <= q) return 0;
  p = q;
  return 1;
}
template <typename X>
inline bool maximize(X& p, X q) {
  if (p >= q) return 0;
  p = q;
  return 1;
}
const long long mod = 10000000000ll;
inline long long P(long long p, long long q) {
  p %= mod;
  q %= mod;
  long long p1 = p / 100000, p2 = p % 100000;
  long long q1 = q / 100000, q2 = q % 100000;
  return (p2 * q2 + (p1 * q2 + p2 * q1) * 100000) % mod;
}
inline long long F(long long p, long long q) {
  if (p % 2 == 0)
    p /= 2;
  else
    q /= 2;
  return P(p, q);
}
inline long long G(long long p, long long q, long long r) {
  if (p % 2 == 0)
    p /= 2;
  else if (q % 2 == 0)
    q /= 2;
  else
    r /= 2;
  if (p % 3 == 0)
    p /= 3;
  else if (q % 3 == 0)
    q /= 3;
  else
    r /= 3;
  return P(P(p, q), r);
}
inline long long sum(long long x, long long y) {
  if (x == y) return F(x * x, x * x + 1);
  if (x > y)
    return F(y * y, y * y + 1) +
           P(y, G(x, x - 1, 2 * x - 1) - G(y, y - 1, 2 * y - 1)) +
           P(x - y, F(y, y + 1));
  else
    return F(x * x, x * x + 1) +
           P(x, G(y, y + 1, 2 * y + 1) - G(x, x + 1, 2 * x + 1)) -
           P(y - x, F(x, x - 1));
}
inline long double sumd(long double x, long double y) {
  if (x >= y)
    return 0.5 * y * y * (y * y + 1) +
           y * (x * (x - 1) * (2 * x - 1) - y * (y - 1) * (2 * y - 1)) / 6 +
           0.5 * (x - y) * y * (y + 1);
  else
    return 0.5 * x * x * (x * x + 1) +
           x * (y * (y + 1) * (2 * y + 1) - x * (x + 1) * (2 * x + 1)) / 6 -
           0.5 * (y - x) * x * (x - 1);
}
int main() {
  int T, x1, y1, x2, y2;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    long long ans = ((sum(x2, y2) - sum(x1 - 1, y2) - sum(x2, y1 - 1) +
                      sum(x1 - 1, y1 - 1)) %
                         mod +
                     mod) %
                    mod;
    long double ansd = sumd(x2, y2) - sumd(x1 - 1, y2) - sumd(x2, y1 - 1) +
                       sumd(x1 - 1, y1 - 1);
    if (ansd > mod)
      printf("...%010I64d\n", ans);
    else
      printf("%I64d\n", ans);
  }
  return 0;
}
