#include <bits/stdc++.h>
using namespace std;
long long mod, mmod = 2e10, val = 1e16;
long long ksc(long long x, long long y) {
  long long res = 0;
  while (y) {
    if (y & 1) res += x;
    x <<= 1;
    if (x >= val) x %= mod;
    y >>= 1;
  }
  return res % mod;
}
long long qwq(long long x, long long y) {
  if (x == 0 || y == 0) return 0;
  long long s, x2 = ksc(x, x), qaq;
  if (x == y) {
    if (x2 % 2 == 0)
      s = ksc(x2 / 2, x2 + 1);
    else
      s = ksc(x2, (x2 + 1) / 2);
    return s;
  }
  if (x < y) {
    if (x2 % 2 == 0)
      s = ksc(x2 / 2, x2 + 1);
    else
      s = ksc(x2, (x2 + 1) / 2);
    qaq = ksc(x + 3, y - x) - ksc(x + y + 1, 2 * y - 2 * x);
    if (y % 3 == 0) qaq += ksc(ksc(y + 1, y * 2 + 1), y / 3);
    if (y % 3 == 1) qaq += ksc(ksc(y + 1, (y * 2 + 1) / 3), y);
    if (y % 3 == 2) qaq += ksc(ksc((y + 1) / 3, y * 2 + 1), y);
    if (x % 3 == 0) qaq -= ksc(ksc(x + 1, x * 2 + 1), x / 3);
    if (x % 3 == 1) qaq -= ksc(ksc(x + 1, (x * 2 + 1) / 3), x);
    if (x % 3 == 2) qaq -= ksc(ksc((x + 1) / 3, x * 2 + 1), x);
    qaq = (qaq % mod + mod) % mod;
    if (qaq % 2 == 0)
      s = (s + ksc(x, qaq / 2)) % mod;
    else {
      if (mod % 2)
        s = (s + ksc(x, (qaq + mod) / 2)) % mod;
      else
        s = (s + ksc(x / 2, qaq)) % mod;
    }
  }
  if (x > y) {
    swap(x, y);
    x2 = ksc(x, x);
    if (x2 % 2 == 0)
      s = ksc(x2 / 2, x2 + 1);
    else
      s = ksc(x2, (x2 + 1) / 2);
    qaq = -ksc(x - 1, y - x);
    if (y % 3 == 0) qaq += ksc(ksc(y + 1, y * 2 + 1), y / 3);
    if (y % 3 == 1) qaq += ksc(ksc(y + 1, (y * 2 + 1) / 3), y);
    if (y % 3 == 2) qaq += ksc(ksc((y + 1) / 3, y * 2 + 1), y);
    if (x % 3 == 0) qaq -= ksc(ksc(x + 1, x * 2 + 1), x / 3);
    if (x % 3 == 1) qaq -= ksc(ksc(x + 1, (x * 2 + 1) / 3), x);
    if (x % 3 == 2) qaq -= ksc(ksc((x + 1) / 3, x * 2 + 1), x);
    qaq = (qaq % mod + mod) % mod;
    if (qaq % 2 == 0)
      s = (s + ksc(x, qaq / 2)) % mod;
    else {
      if (mod % 2)
        s = (s + ksc(x, (qaq + mod) / 2)) % mod;
      else
        s = (s + ksc(x / 2, qaq)) % mod;
    }
  }
  return s;
}
signed main() {
  long long T, x1, y1, x2, y2;
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
    mod = mmod / 2 + 9;
    long long k1 = (qwq(x2, y2) + qwq(x1 - 1, y1 - 1) - qwq(x1 - 1, y2) -
                    qwq(x2, y1 - 1) + mod * 10) %
                   mod;
    mod = mmod;
    long long k2 = (qwq(x2, y2) + qwq(x1 - 1, y1 - 1) - qwq(x1 - 1, y2) -
                    qwq(x2, y1 - 1) + mod * 10) %
                   mod;
    if (k1 == k2)
      printf("%lld\n", k2);
    else
      printf("...%010lld\n", k2 % (mmod / 2));
  }
  return 0;
}
