#include <bits/stdc++.h>
using namespace std;
const long long mo = 10000000000ll;
long long mul(long long x, long long y) {
  x %= mo;
  y %= mo;
  long long xa = x / 100000;
  long long xb = x % 100000;
  return (xa * y % mo * 100000 + xb * y) % mo;
}
long long x2(long long n) {
  return (n & 1) ? (mul(n, (n + 1) / 2)) : (mul(n / 2, (n + 1)));
}
long long x3(long long n) {
  int p = n % 3;
  if (p == 0) return mul(mul(n / 3, n + 1), n - 1);
  if (p == 1) return mul(mul(n, ((n - 1) / 3)), n + 1);
  return mul(mul(n, ((n + 1) / 3)), n - 1);
}
long long md2(long long a, long long b) {
  return (a & 1) ? (mul(a, b / 2)) : (mul(a / 2, b));
}
long double dsum(long double x, long double y) {
  if (!x || !y) return 0;
  long double c = min(x, y);
  long double ans = (c * c) / 2.0 * (c * c + 1);
  if (x > y) {
    long double bg = (c + 1) * (c + 1);
    long double tsum = (bg + bg - y + 1) / 2.0 * y;
    long double n = x - c;
    ans = (ans + (tsum * n));
    n--;
    ans +=
        ((2 * c + 3) * (n * (n + 1) / 2.0) + (n * (n + 1) * (n - 1) / 3)) * y;
  }
  if (y > x) {
    long double bg = c * c + 1;
    long double tsum = (bg + bg + x - 1) * x / 2.0;
    long double n = y - c;
    ans = (ans + (tsum * n));
    n--;
    ans +=
        ((2 * c + 1) * (n * (n + 1) / 2.0) + (n * (n + 1) * (n - 1) / 3)) * x;
  }
  return ans;
}
long long sum(long long x, long long y) {
  if (!x || !y) return 0;
  long long c = min(x, y);
  long long ans = x2(c * c);
  if (x > y) {
    long long bg = mul(c + 1, c + 1);
    long long tsum = md2((bg + bg - y + 1), y);
    long long n = x - c;
    ans = (ans + mul(tsum, n)) % mo;
    n--;
    ans += mul(mul(2 * c + 3, x2(n)) + x3(n), y);
  }
  if (y > x) {
    long long bg = mul(c, c) + 1;
    long long tsum = md2((bg + bg + x - 1), x);
    long long n = y - c;
    ans = (ans + mul(tsum, n)) % mo;
    n--;
    ans += mul(mul(2 * c + 1, x2(n)) + x3(n), x);
  }
  return ans % mo;
}
int main() {
  int t = 0;
  scanf("%d", &t);
  while (t--) {
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    long double ad = (dsum(x2, y2) + dsum(x1 - 1, y1 - 1) - dsum(x1 - 1, y2) -
                      dsum(x2, y1 - 1));
    long long ans = (sum(x2, y2) + sum(x1 - 1, y1 - 1) - sum(x1 - 1, y2) -
                     sum(x2, y1 - 1) + mo) %
                    mo;
    while (ans < 0) ans = (ans + mo) % mo;
    if (ad >= 1e10)
      printf("...%010I64d\n", ans);
    else
      printf("%I64d\n", ans);
  }
  return 0;
}
