#include <bits/stdc++.h>
char ch;
inline void read(int &x) {
  x = 0;
  ch = getchar();
  while (ch <= 32) ch = getchar();
  while (ch > 32) {
    x = x * 10 + ch - 48;
    ch = getchar();
  };
};
inline long long mul(long long x, long long y) {
  x = (x % 10000000000LL + 10000000000LL) % 10000000000LL;
  y = (y % 10000000000LL + 10000000000LL) % 10000000000LL;
  return (x * y -
          (long long)(x / (long double)10000000000LL * y + 1e-3) *
              10000000000LL +
          10000000000LL) %
         10000000000LL;
};
inline long long f1(long long x) {
  int t = 1;
  long long y = x + 1;
  if (x % 2 == 0) x /= 2, t *= 2;
  if (y % 2 == 0) y /= 2, t *= 2;
  return 1LL * (t / 2) * mul(x, y) % 10000000000LL;
};
inline long long f1_(long long x) { return x * (x + 1) / 2; };
inline long long f2(long long x) {
  int t = 1;
  long long y = x + 1, z = 2 * x + 1;
  if (x % 2 == 0) x /= 2, t *= 2;
  if (x % 3 == 0) x /= 3, t *= 3;
  if (y % 2 == 0) y /= 2, t *= 2;
  if (y % 3 == 0) y /= 3, t *= 3;
  if (z % 2 == 0) z /= 2, t *= 2;
  if (z % 3 == 0) z /= 3, t *= 3;
  return 1LL * mul(mul(x, y), z) * (t / 6) % 10000000000LL;
};
inline long long f2_(long long x) { return x * (x + 1) * (2 * x + 1) / 6; };
inline long long query(int x, int y) {
  if (x <= 0 || y <= 0) return 0;
  if (x > y) {
    return (f1(1LL * y * y) + mul(f2(x) - f2(y), y) - mul(f1(y - 1), x - y)) %
           10000000000LL;
  } else {
    return (f1(1LL * x * x) + mul(f2(y - 1) - f2(x - 1), x) +
            mul(f1(x), y - x)) %
           10000000000LL;
  };
};
inline long long query_(int x, int y) {
  if (x <= 0 || y <= 0) return 0;
  if (x > y) {
    return f1_(1LL * y * y) + 1LL * y * (f2_(x) - f2_(y)) -
           1LL * (x - y) * f1_(y - 1);
  } else {
    return f1_(1LL * x * x) + 1LL * x * (f2_(y - 1) - f2_(x - 1)) +
           1LL * (y - x) * f1_(x);
  };
};
int main() {
  int T;
  read(T);
  while (T--) {
    int x1, y1, x2, y2;
    read(x1);
    read(y1);
    read(x2);
    read(y2);
    long long A, B;
    A = (query(x1 - 1, y1 - 1) + query(x2, y2) - query(x1 - 1, y2) -
         query(x2, y1 - 1)) %
        10000000000LL;
    A = (A + 10000000000LL) % 10000000000LL;
    B = query_(x1 - 1, y1 - 1) + query_(x2, y2) - query_(x1 - 1, y2) -
        query_(x2, y1 - 1);
    if (A != B)
      printf("...%010I64d\n", A);
    else
      printf("%I64d\n", A);
  };
}
