#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
int mas[101][101];
inline void fill() {
  int c = 1;
  for (int _n((100) - 1), h(0); h <= _n; h++) {
    for (int _n((h + 1) - 1), i(0); i <= _n; i++) {
      mas[i][h] = c++;
    }
    for (int i = (h - 1), _b = (0); i >= _b; i--) {
      mas[h][i] = c++;
    }
  }
}
inline int brute(int x1, int y1, int x2, int y2) {
  int ans = 0;
  for (int _n(x2), i(x1); i <= _n; i++) {
    for (int _n(y2), j(y1); j <= _n; j++) {
      ans += mas[i][j];
    }
  }
  return ans;
}
inline long long mul(long long a, long long b, long long mod) {
  a %= mod;
  b %= mod;
  long long ans = 0;
  while (b) {
    if (b % 2) {
      ans += a;
      if (ans >= mod) ans -= mod;
    }
    a += a;
    if (a >= mod) a -= mod;
    b /= 2;
  }
  return ans;
}
const long long mod = 100000000000LL;
inline long long square(int s) {
  long long aa = (long long)s * s % (2 * mod);
  long long ans = mul(aa, aa, 2 * mod);
  ans = (ans / 2 + aa / 2 + s % 2) % mod;
  return ans;
}
inline double square_double(int s) {
  return (double)s * s * s * s / 2 + (double)s * s / 2 + (double)(s % 2);
}
inline long long row(int r) {
  long long rr = (long long)r * r % (6 * mod);
  long long r3 = mul(rr, r * 2, 6 * mod);
  long long ans = (r3 - rr * 3 + (long long)r * 7) % (6 * mod);
  if (ans < 0) ans += 6 * mod;
  return ans / 6 % mod;
}
inline double row_double(int r) {
  return (double)r * r * r / 3 - (double)r * r / 2 + (double)7 * r / 6;
}
inline double col_double(int r) {
  return (double)r * r * r / 3 + (double)r * r / 2 + (double)r / 6;
}
inline long long col(int r) {
  long long rr = (long long)r * r % (6 * mod);
  long long r3 = mul(rr, r * 2, 6 * mod);
  long long ans = (r3 + rr * 3 + r) % (6 * mod);
  return ans / 6;
}
inline long long solve(long long r, long long c) {
  if (r <= 0 || c <= 0) return 0;
  long long s = square(min(r, c));
  if (c == r) return s;
  if (c > r) {
    long long start = row(c) - row(r);
    start %= mod;
    if (start < mod) start += mod;
    s = (s + mul(start, r, mod)) % mod;
    long long add = mul(r - 1, r, mod * 2) / 2 % mod;
    s = (s + mul(add, c - r, mod)) % mod;
    return s;
  } else {
    long long start = col(r) - col(c);
    start %= mod;
    if (start < mod) start += mod;
    s = (s + mul(start, c, mod)) % mod;
    long long add = mul(c - 1, c, 2 * mod) / 2 % mod;
    s = (s - mul(add, r - c, mod)) % mod;
    if (s < 0) s += mod;
    return s;
  }
}
inline double solve_double(long long r, long long c) {
  if (r <= 0 || c <= 0) return 0;
  double s = square_double(min(r, c));
  if (c == r) return s;
  if (c > r) {
    double start = row_double(c) - row_double(r);
    s += start * r;
    double add = (double)(r - 1) * r / 2;
    s += add * (c - r);
    return s;
  } else {
    double start = col_double(r) - col_double(c);
    s += start * c;
    double add = (double)(c - 1) * c / 2;
    s -= add * (r - c);
    return s;
  }
}
inline long long solve(int x1, int y1, int x2, int y2) {
  long long ans = solve(x2, y2) - solve(x1 - 1, y2) - solve(x2, y1 - 1) +
                  solve(x1 - 1, y1 - 1);
  ans %= mod;
  if (ans < 0) ans += mod;
  return ans;
}
inline double solve_double(int x1, int y1, int x2, int y2) {
  double ans = solve_double(x2, y2) - solve_double(x1 - 1, y2) -
               solve_double(x2, y1 - 1) + solve_double(x1 - 1, y1 - 1);
  return ans;
}
int main() {
  int kolt;
  scanf("%d", &kolt);
  for (int _n((kolt)), hod(1); hod <= _n; hod++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    long long ans = solve(x1, y1, x2, y2);
    double ans2 = solve_double(x1, y1, x2, y2);
    if (ans2 > 5e10 || ans >= (long long)1000000000 * 10) {
      ostringstream oss;
      oss << (ans % ((long long)1000000000 * 10));
      string s = oss.str();
      while ((int)((s).size()) < 10) s = "0" + s;
      cout << "..." << s << "\n";
    } else {
      cout << ans << "\n";
    }
  }
  exit(0);
}
