#include <bits/stdc++.h>
using namespace std;
long long mod = 10000000000;
long long fix(long long x) {
  x %= mod;
  x += mod;
  return x % mod;
}
struct modInteger {
  long long val;
  modInteger() { val = 0; }
  modInteger(long long v) { val = fix(v); }
  modInteger operator+(const modInteger &u) { return modInteger(val + u.val); }
  modInteger operator-(const modInteger &u) { return modInteger(val - u.val); }
  modInteger operator*(const modInteger &u) {
    long long ret = 0;
    long long _val = val;
    long long uval = u.val;
    while (_val) {
      ret += uval * (_val % 1024);
      uval <<= 10;
      uval %= mod;
      _val >>= 10;
      ret %= mod;
    }
    return modInteger(ret);
  }
};
modInteger sumSquares(long long x) {
  long long a = x;
  long long b = x + 1;
  long long c = 2 * x + 1;
  if (a % 2 == 0)
    a /= 2;
  else
    b /= 2;
  if (a % 3 == 0)
    a /= 3;
  else if (b % 3 == 0)
    b /= 3;
  else
    c /= 3;
  return modInteger(a) * modInteger(b) * modInteger(c);
}
modInteger mulDiv2(long long a, long long b) {
  if (a % 2 == 0)
    a /= 2;
  else
    b /= 2;
  return modInteger(a) * modInteger(b);
}
long long calc(long long _x, long long _y) {
  if (_x == 0 || _y == 0) return 0;
  modInteger x(_x), y(_y);
  modInteger ans(0);
  if (_x < _y) {
    long long first = _x + 1;
    long long terms = _y - _x;
    long long last = first + 2 * (terms - 1);
    modInteger sum = mulDiv2((first + last), terms);
    ans = ans - sum * x;
    swap(x, y);
    swap(_x, _y);
  }
  ans = ans + mulDiv2((1 + _y * _y), (_y * _y));
  if (_x > _y) {
    modInteger firstCol = sumSquares(_x) - sumSquares(_y);
    modInteger diffEachRow = mulDiv2(_y, _y - 1);
    ans = ans + firstCol * y - diffEachRow * (x - y);
  }
  return ans.val;
}
long long solveMod(long long _mod, long long x1, long long y1, long long x2,
                   long long y2) {
  mod = _mod;
  long long ans = calc(x2, y2);
  ans += calc(x1 - 1, y1 - 1);
  ans -= calc(x1 - 1, y2);
  ans -= calc(x2, y1 - 1);
  return fix(ans);
}
string extend(long long x) {
  string ret;
  while (x) {
    ret = char(x % 10 + '0') + ret;
    x /= 10;
  }
  while (ret.length() < 10) ret = "0" + ret;
  return ret;
}
int MAIN() {
  int T;
  cin >> T;
  long long x1, y1, x2, y2;
  for (int i = 1; i <= T; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    long long ans1 = solveMod(10000000000, x1, y1, x2, y2);
    long long ans2 = solveMod(14564897899, x1, y1, x2, y2);
    long long ans3, ans4;
    if (ans1 == ans2)
      ans3 = solveMod(10000000000 + rand() % 1000 + 2000, x1, y1, x2, y2);
    if (ans2 == ans3)
      ans4 = solveMod(10000000000 + rand() % 1000 + 3000, x1, y1, x2, y2);
    if (ans1 == ans2 && ans2 == ans3 && ans3 == ans4)
      cout << ans1 << endl;
    else
      cout << "..." << extend(ans1) << endl;
  }
  return 0;
}
int main() {
  srand((unsigned)time(NULL));
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}
