#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e10;
long long Element(int x, int y) {
  if (x > y) return (x - 1LL) * (x - 1LL) + y;
  return (long long)y * y - x + 1;
}
void adjust(long long &x) {
  if (x < 0 || x >= MOD) {
    x %= MOD;
    if (x < 0) x += MOD;
  }
}
long long mul(long long x, long long y) {
  adjust(x);
  adjust(y);
  long long ret = 0;
  while (y) {
    if (y & 1LL) {
      ret += x;
      if (ret >= MOD) ret -= MOD;
    }
    y >>= 1;
    x <<= 1;
    if (x >= MOD) x -= MOD;
  }
  return ret;
}
long long f1(long long n) {
  if (n <= 0) return 0;
  if (n & 1LL) return mul(n, (n + 1) / 2);
  return mul(n / 2, n + 1);
}
long long f1(long long a, long long b) { return (f1(b) - f1(a - 1)) % MOD; }
long long f2(long long n) {
  if (n <= 0) return 0;
  long long a[3] = {n, n + 1, 2 * n + 1};
  for (int i = (0); i <= (2); i++)
    if (a[i] % 2 == 0) {
      a[i] /= 2;
      break;
    }
  for (int i = (0); i <= (2); i++)
    if (a[i] % 3 == 0) {
      a[i] /= 3;
      break;
    }
  return mul(mul(a[0], a[1]), a[2]);
}
long long f2(long long a, long long b) { return (f2(b) - f2(a - 1)) % MOD; }
long long doit(long long x, long long y) {
  if (!x || !y) return 0;
  if (x == y) return f1(x * x);
  long long ret = 0;
  if (x > y) {
    ret = (ret + f1(y * y)) % MOD;
    ret = (ret + mul(y, f2(y, x - 1))) % MOD;
    ret = (ret + mul(f1(y), (x - 1) - y + 1)) % MOD;
    return ret;
  }
  ret = (ret + f1(x * x)) % MOD;
  ret = (ret + mul(x, f2(x + 1, y))) % MOD;
  ret = (ret - mul(f1(x - 1), y - (x + 1) + 1)) % MOD;
  return ret;
}
int main() {
  int TT;
  cin >> TT;
  for (int tt = (1); tt <= (TT); tt++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    swap(x1, y1), swap(x2, y2);
    long long ret = 0;
    for (int x = x1; x <= x2 && ret < MOD; x++)
      for (int y = y1; y <= y2 && ret < MOD; y++) ret += Element(x, y);
    if (ret < MOD)
      cout << ret << endl;
    else {
      ret = doit(x2, y2) - doit(x2, y1 - 1) - doit(x1 - 1, y2) +
            doit(x1 - 1, y1 - 1);
      adjust(ret);
      cout << "...";
      for (long long x = MOD / 10; x != 1; x /= 10)
        if (ret < x) cout << 0;
      cout << ret << endl;
    }
  }
  return 0;
}
