#include <bits/stdc++.h>
const long long mo = 1000000000000000000LL;
const long long tt = 10000000000LL;
const long long B = 1000000000LL;
struct pnt {
  long long x, y;
  pnt(long long x = 0, long long y = 0) : x(x), y(y) {}
  pnt operator+(pnt a) {
    long long ty = a.y + y;
    long long tx = a.x + x;
    if (ty >= mo) ty -= mo, tx++;
    return pnt(tx, ty);
  }
  pnt operator-(pnt a) {
    long long ty = y - a.y;
    long long tx = x - a.x;
    if (ty < 0) ty += mo, tx--;
    return pnt(tx, ty);
  }
};
pnt C(long long a, long long b) {
  long long tx = a / B, ty = a % B;
  long long sx = b / B, sy = b % B;
  long long t = sx * tx + (sx * ty + sy * tx) / B;
  long long k = ((sx * ty + sy * tx) % B) * B + ty * sy;
  t += k / mo;
  return pnt(t, k % mo);
}
pnt H(int a, int b) {
  int x = b, y = b - 1, z = 2 * b - 1;
  if (x % 3 == 0) x /= 3;
  if (y % 3 == 0) y /= 3;
  if (z % 3 == 0) z /= 3;
  if (x & 1)
    y >>= 1;
  else
    x >>= 1;
  return C(1LL * a * x, 1LL * y * z);
}
pnt T(long long a) {
  long long x = a, y = a + 1;
  if (x & 1)
    y >>= 1;
  else
    x >>= 1;
  return C(x, y);
}
pnt calc(int a, int b) {
  if (!a || !b) return pnt(0, 0);
  pnt rt;
  if (a <= b) {
    rt = T(1LL * a * a);
    if (a == b) return rt;
    rt = rt + C(1LL * a * (a + 1) / 2, 1LL * (b - a));
    rt = rt + H(a, b) - H(a, a);
    return rt;
  } else {
    rt = T(1LL * b * b);
    rt = rt + H(b, a + 1) - H(b, b + 1);
    rt = rt - C(1LL * b * (b - 1) / 2, 1LL * (a - b));
    return rt;
  }
}
int main() {
  int T, a, b, c, d;
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d %d %d\n", &a, &b, &c, &d);
    pnt tp = calc(c, d) + calc(a - 1, b - 1) - calc(a - 1, d) - calc(c, b - 1);
    if (tp.x == 0 && tp.y < tt)
      printf("%I64d\n", tp.y);
    else
      printf("...%010I64d\n", tp.y % tt);
  }
  return 0;
}
