#include <bits/stdc++.h>
using namespace std;
const long long P = (long long)1e11, Q = 66666666667ll * 5;
long long m(long long a, long long b) {
  long long r = a * b - (long long)((long double)a * b / P + 0.5) * P;
  return r < 0 ? r + P : r;
}
long long f(long long x, long long y) {
  if (x < y)
    return m(m(m(x, m(x, x)) - x + m(4, y) + m(3, m(x, y)) - m(3, m(y, y)) +
                   m(2, m(y, m(y, y))) + P + P,
               x),
             Q);
  return m(m(m(4, x) + m(3, m(x, x)) + m(2, m(x, m(x, x))) - y - m(3, m(x, y)) +
                 m(y, m(y, y)),
             y) +
               P + P,
           Q);
}
long double g(long double x, long double y) {
  if (x < y)
    return (x * x * x - x + 4 * y + 3 * x * y - 3 * y * y + 2 * y * y * y) * x /
           6;
  return (4 * x + 3 * x * x + 2 * x * x * x - y - 3 * x * y + y * y * y) * y /
         6;
}
int main() {
  int T, x1, y1, x2, y2;
  long long ans;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2), --x1, --y1;
    ans = (f(x2, y2) - f(x1, y2) - f(x2, y1) + f(x1, y1) + P + P) % P / 10;
    if (g(x2, y2) - g(x1, y2) - g(x2, y1) + g(x1, y1) < 1e10)
      printf("%lld\n", ans);
    else
      printf("...%010lld\n", ans);
  }
  return 0;
}
