#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = 10000000000;
const unsigned long long pow32 = 4294967296;
const unsigned long long ullong_max = 18446744073709551615;
const unsigned long long rem1 = ((ullong_max % mod) / 100000) * 100000;
const unsigned long long rem2 = ullong_max % 100000 + 1;
struct bigint {
 public:
  unsigned long long l;
  unsigned long long r;
};
bigint add(bigint a, bigint b);
bigint sub(bigint a, bigint b);
bigint mul(unsigned long long a, unsigned long long b);
unsigned long long dif6sumsq_dif(unsigned long long a, unsigned long long b);
unsigned long long addTilla(unsigned long long a);
bigint addTillA(unsigned long long a);
bigint sumEntry(unsigned long long x, unsigned long long y);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  unsigned long long ntest, x1, y1, x2, y2;
  cin >> ntest;
  for (int i = 0; i < ntest; i++) {
    cin >> y1 >> x1 >> y2 >> x2;
    bigint ans = sub(add(sumEntry(x1 - 1, y1 - 1), sumEntry(x2, y2)),
                     add(sumEntry(x1 - 1, y2), sumEntry(x2, y1 - 1)));
    if (ans.l == 0 && ans.r < mod)
      cout << ans.r;
    else {
      unsigned long long l2 = ans.l % 100000;
      unsigned long long temp =
          ((ans.l % mod) * rem2 + l2 * rem1 + ans.r % mod) % mod;
      cout << "...";
      int j;
      string s;
      for (j = 9; j >= 0; j--) {
        if (temp >= pow(10, j)) {
          break;
        }
      }
      s.assign(9 - j, '0');
      cout << s << temp;
    }
    cout << endl;
  }
  cin.get();
  cin.get();
  return 0;
}
bigint add(bigint a, bigint b) {
  if (a.r > ullong_max - b.r) {
    a.r -= ullong_max - b.r + 1;
    a.l += b.l + 1;
  } else {
    a.r += b.r;
    a.l += b.l;
  }
  return a;
}
bigint sub(bigint a, bigint b) {
  if (a.r >= b.r) {
    a.r -= b.r;
    a.l -= b.l;
  } else {
    a.r += ullong_max - b.r + 1;
    a.l -= b.l + 1;
  }
  return a;
}
bigint mul(unsigned long long a, unsigned long long b) {
  unsigned long long a1 = a / pow32, a2 = a % pow32, b1 = b / pow32,
                     b2 = b % pow32;
  bigint ans;
  unsigned long long temp = a1 * b2 + a2 * b1;
  ans.l = a1 * b1 + temp / pow32;
  ans.r = (temp % pow32) * pow32;
  bigint temp1;
  temp1.l = 0;
  temp1.r = a2 * b2;
  return add(ans, temp1);
}
unsigned long long dif6sumsq_dif(unsigned long long a, unsigned long long b) {
  return 2 * (a * a + b * b + a * b) + 3 * (a + b) + 1;
}
unsigned long long addTilla(unsigned long long a) { return ((a + 1) * a) / 2; }
bigint addTillA(unsigned long long a) {
  if (a & 1)
    return mul(a, (a + 1) / 2);
  else
    return mul(a / 2, a + 1);
}
bigint sumEntry(unsigned long long x, unsigned long long y) {
  if (x > y) {
    unsigned long long temp1 = (x - y) * y;
    unsigned long long temp2 = dif6sumsq_dif(x - 1, y - 1);
    if (!(temp1 & 1))
      temp1 >>= 1;
    else
      temp2 >>= 1;
    if (temp1 % 3 == 0)
      temp1 /= 3;
    else
      temp2 /= 3;
    bigint temp3 = mul(temp1, temp2);
    bigint temp4 = mul(x - y, addTilla(y));
    temp3 = add(temp3, temp4);
    temp3 = add(temp3, addTillA(y * y));
    return temp3;
  } else {
    unsigned long long temp1 = (y - x) * x;
    unsigned long long temp2 = dif6sumsq_dif(y, x);
    if (!(temp1 & 1))
      temp1 >>= 1;
    else
      temp2 >>= 1;
    if (temp1 % 3 == 0)
      temp1 /= 3;
    else
      temp2 /= 3;
    bigint temp3 = mul(temp1, temp2);
    bigint temp4 = mul(y - x, addTilla(x - 1));
    temp3 = sub(temp3, temp4);
    temp3 = add(temp3, addTillA(x * x));
    return temp3;
  }
}
