#include <bits/stdc++.h>
using namespace std;
const unsigned long long MOD = 10000000000ULL;
int a, b, c, d;
unsigned long long s1(unsigned long long x0) {
  unsigned long long ret;
  if (x0 & 1)
    ret = (x0 + 1) / 2 * ((2 * x0 + 1)) % MOD * x0 % MOD;
  else
    ret = (x0) / 2 * (2 * x0 + 1) % MOD * (x0 + 1) % MOD;
  while (ret % 3) ret += MOD;
  ret /= 3;
  return ret % MOD;
}
long double s(long double x) { return (x + 1) * x * (2 * x + 1) / 6; }
unsigned long long f1(unsigned long long x, unsigned long long y) {
  unsigned long long key1 = min(x, y);
  unsigned long long ret;
  if (key1 & 1)
    ret = (key1 * key1 + 1) / 2 % MOD * key1 % MOD * key1 % MOD;
  else
    ret = (key1 * key1 + 1) % MOD * (key1) % MOD * (key1 / 2) % MOD;
  if (x < y)
    (ret += ((s1(y - 1) + MOD - s1(x - 1)) % MOD * x % MOD +
             (x + 1) * x / 2 % MOD * (y - x) % MOD) %
            MOD) %= MOD;
  else if (x > y)
    (ret += ((s1(x) + MOD - s1(y)) % MOD * y % MOD + MOD -
             (y - 1) * y / 2 % MOD * (x - y) % MOD) %
            MOD) %= MOD;
  return ret;
}
long double f(long double x, long double y) {
  long double key1 = min(x, y);
  long double ret;
  ret = (key1 * key1 + 1) * key1 * key1 / 2;
  if (x < y)
    ret += (s(y - 1) - s(x - 1)) * x + (x + 1) * x / 2 * (y - x);
  else if (x > y)
    ret += (s(x) - s(y)) * y - (y - 1) * y / 2 * (x - y);
  return ret;
}
int main() {
  int tesc;
  scanf("%d", &tesc);
  for (int testc = 1; testc <= tesc; testc++) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    --a;
    --b;
    unsigned long long ans =
        f1(a, b) - f1(c, b) - f1(a, d) + f1(c, d) + 10 * MOD;
    long double check = f(a, b) - f(c, b) - f(a, d) + f(c, d);
    if (check < MOD)
      printf("%I64u\n", ans % MOD);
    else
      printf("...%010I64u\n", ans % MOD);
  }
  return 0;
}
