#include <bits/stdc++.h>
using namespace std;
long long MOD = 10000000000LL;
long long prod(long long a, long long b) {
  a = a % MOD;
  b = b % MOD;
  return (((a / 100) * b) % MOD * 100 + (a % 100) * b) % MOD;
  ;
}
long long sumn2(int n) {
  if (n < 1) return 0;
  long long ans = 1LL * n * (n + 1) / 2;
  if (ans % 3 == 0) return prod(ans / 3, 2 * n + 1);
  return prod(ans, (2 * n + 1) / 3);
}
long long sump(int x, int y) {
  if (x <= 0 || y <= 0) return 0;
  int m = min(x, y);
  long long ans = 1LL * m * m;
  if (m % 2)
    ans = prod(ans, (1LL * m * m + 1) / 2);
  else
    ans = prod(ans / 2, 1LL * m * m + 1);
  if (x > y) {
    long long line = (MOD + sumn2(x) - sumn2(y) + MOD) % MOD;
    long long sub = (1LL * y * (y - 1) / 2) % MOD;
    return (ans + prod(line, y) + MOD - prod(sub, x - y)) % MOD;
  } else if (y > x) {
    long long line = (MOD + sumn2(y - 1) - sumn2(x - 1) + MOD) % MOD;
    long long add = (1LL * x * (x + 1) / 2) % MOD;
    return (ans + prod(line, x) + prod(add, y - x)) % MOD;
  }
  return ans;
}
int main() {
  int t = 0, x1, y1, x2, y2;
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    long long ans = (sump(x2, y2) + MOD * 2 - sump(x2, y1 - 1) -
                     sump(x1 - 1, y2) + sump(x1 - 1, y1 - 1)) %
                    MOD;
    MOD++;
    long long ans2 = (sump(x2, y2) + MOD * 2 - sump(x2, y1 - 1) -
                      sump(x1 - 1, y2) + sump(x1 - 1, y1 - 1)) %
                     MOD;
    MOD--;
    if (ans != ans2)
      printf("...%010I64d\n", ans);
    else
      printf("%I64d\n", ans);
  }
  return 0;
}
