#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int kSize = 50;

struct Int {
  int v[kSize], ln;

  Int() {
    ln = 1;
    fill(&v[0], &v[kSize], 0);
  }

  Int(ll q) {
    ln = 0;
    fill(&v[0], &v[kSize], 0);
    do {
      v[ln++] = q % 10, q /= 10;
    } while (q > 0);
  }

  Int & set_ln() {
    for (ln = kSize; ln > 1; --ln)
      if (v[ln - 1])
        break;
    return *this;
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx, sum, carry;

    mx = max(ln, ri.ln), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry + v[i] + ri.v[i];
      ret.v[i] = sum % 10, carry = sum / 10;
    }

    if(carry > 0)
      ret.v[i] = carry;

    return ret.set_ln();
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx, sub, carry;

    mx = ln, sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i] - ri.v[i], carry = 0;
      if (sub < 0) sub += 10, carry = -1;
      ret.v[i] = sub;
    }

    return ret.set_ln();
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry, i, j;

    for (i = 0; i < ri.ln; ++i) {
      mul = carry = 0;
      for (j = 0; j < ln; ++j) {
        mul = carry + ri.v[i] * v[j] + ret.v[i + j];
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }

      if (carry > 0)
        ret.v[i + j] = carry;
    }

    return ret.set_ln();
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (ri.ln > 10)
      os << "...";
    for (int i = min(ri.ln, 10) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int ldt(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res(0);
  res += ldt(X2, Y2) + ldt(X1 - 1, Y1 - 1) - ldt(X2, Y1 - 1) - ldt(X1 - 1, Y2);
  cout << res << "\n";
}

Int ldt(ll x, ll y) {
  Int ret;

  if (x <= 0 || y <= 0)
    return Int(0);

  ret = howdy1(min(x, y) * min(x, y));
  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
    ret += howdy1(x) * Int(y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * Int(y);
    ret -= howdy1(y - 1) * Int(x - y);
  }

  return ret;
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);

  if (x % 2)
    return Int(x) * Int((x + 1) / 2);
  else
    return Int(x / 2) * Int(x + 1);
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &i) {
    ll g = gcd(i, d);
    i /= g, d /= g;
  });

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

typedef long long ll;
const int kSize = 30;

struct Int {
  int v[kSize], ln;

  Int() {
    ln = 1;
    fill(&v[0], &v[kSize], 0);
  }

  Int(ll q) {
    ln = 0;
    fill(&v[0], &v[kSize], 0);
    do {
      v[ln++] = q % 10, q /= 10;
    } while (q > 0);
  }

  Int & set_ln() {
    for (ln = kSize; ln > 1; --ln)
      if (v[ln - 1])
        break;
    return *this;
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx, sum, carry;

    mx = max(ln, ri.ln), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry + v[i] + ri.v[i];
      ret.v[i] = sum % 10, carry = sum / 10;
    }

    if(carry > 0)
      ret.v[i] = carry;

    return ret.set_ln();
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx, sub, carry;

    mx = ln, sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i] - ri.v[i], carry = 0;
      if (sub < 0) sub += 10, carry = -1;
      ret.v[i] = sub;
    }

    return ret.set_ln();
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry, i, j;

    for (i = 0; i < ri.ln; ++i) {
      mul = carry = 0;
      for (j = 0; j < ln; ++j) {
        mul = carry + ri.v[i] * v[j] + ret.v[i + j];
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }

      if (carry > 0)
        ret.v[i + j] = carry;
    }

    return ret.set_ln();
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (ri.ln > 10)
      os << "...";
    for (int i = min(ri.ln, 10) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }

  void print() const {
    if (ln > 10)
      printf("...");
    for (int i = min(ln, 10) - 1; i >= 0; --i)
      printf("%d", v[i]);
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int ldt(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
//  ios::sync_with_stdio(false);
//  cin >> Z;
  scanf(" %d", &Z);
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
//  cin >> X1 >> Y1 >> X2 >> Y2;
  int x1, y1, x2, y2;
  scanf(" %d %d %d %d", &x1, &y1, &x2, &y2);
  X1 = x1, Y1 = y1, X2 = x2, Y2 = y2;
}

void soups_on() {
  Int res(0);
  res += ldt(X2, Y2) + ldt(X1 - 1, Y1 - 1) - ldt(X2, Y1 - 1) - ldt(X1 - 1, Y2);
  res.print();
  printf("\n");
}

Int ldt(ll x, ll y) {
  Int ret;

  if (x <= 0 || y <= 0)
    return Int(0);

  ret = howdy1(min(x, y) * min(x, y));
  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
    ret += howdy1(x) * Int(y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * Int(y);
    ret -= howdy1(y - 1) * Int(x - y);
  }

  return ret;
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);

  if (x % 2)
    return Int(x) * Int((x + 1) / 2);
  else
    return Int(x / 2) * Int(x + 1);
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &i) {
    ll g = gcd(i, d);
    i /= g, d /= g;
  });

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int kSize = 30;

struct Int {
  int v[kSize], ln;

  Int() {
    ln = 1;
    fill(&v[0], &v[kSize], 0);
  }

  Int(ll q) {
    ln = 0;
    fill(&v[0], &v[kSize], 0);
    do {
      v[ln++] = q % 10, q /= 10;
    } while (q > 0);
  }

  Int & set_ln() {
    for (ln = kSize; ln > 1; --ln)
      if (v[ln - 1])
        break;
    return *this;
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx, sum, carry;

    mx = max(ln, ri.ln), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry + v[i] + ri.v[i];
      ret.v[i] = sum % 10, carry = sum / 10;
    }

    if(carry > 0)
      ret.v[i] = carry;

    return ret.set_ln();
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx, sub, carry;

    mx = ln, sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i] - ri.v[i], carry = 0;
      if (sub < 0) sub += 10, carry = -1;
      ret.v[i] = sub;
    }

    return ret.set_ln();
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry, i, j;

    for (i = 0; i < ri.ln; ++i) {
      mul = carry = 0;
      for (j = 0; j < ln; ++j) {
        mul = carry + ri.v[i] * v[j] + ret.v[i + j];
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }

      if (carry > 0)
        ret.v[i + j] = carry;
    }

    return ret.set_ln();
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (ri.ln > 10)
      os << "...";
    for (int i = min(ri.ln, 10) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int ldt(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res(0);
  res += ldt(X2, Y2) + ldt(X1 - 1, Y1 - 1) - ldt(X2, Y1 - 1) - ldt(X1 - 1, Y2);
  cout << res << "\n";
}

Int ldt(ll x, ll y) {
  Int ret;

  if (x <= 0 || y <= 0)
    return Int(0);

  ret = howdy1(min(x, y) * min(x, y));
  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
    ret += howdy1(x) * Int(y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * Int(y);
    ret -= howdy1(y - 1) * Int(x - y);
  }

  return ret;
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);

  if (x % 2)
    return Int(x) * Int((x + 1) / 2);
  else
    return Int(x / 2) * Int(x + 1);
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &i) {
    ll g = gcd(i, d);
    i /= g, d /= g;
  });

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int kSize = 10;
const ll kBase = 100000;

struct Int {
  ll v[kSize];
  int ln;

  Int() {
    ln = 1;
    fill(&v[0], &v[kSize], 0);
  }

  Int(ll q) {
    ln = 0;
    fill(&v[0], &v[kSize], 0);
    do {
      v[ln++] = q % kBase, q /= kBase;
    } while (q > 0);
  }

  Int & set_ln() {
    for (ln = kSize; ln > 1; --ln)
      if (v[ln - 1])
        break;
    return *this;
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx;
    ll sum, carry;

    mx = max(ln, ri.ln), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry + v[i] + ri.v[i];
      ret.v[i] = sum % kBase, carry = sum / kBase;
    }

    if(carry > 0)
      ret.v[i] = carry;

    return ret.set_ln();
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx;
    ll sub, carry;

    mx = ln, sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i] - ri.v[i], carry = 0;
      if (sub < 0) sub += kBase, carry = -1;
      ret.v[i] = sub;
    }

    return ret.set_ln();
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int i, j;
    ll mul, carry;

    for (i = 0; i < ri.ln; ++i) {
      mul = carry = 0;
      for (j = 0; j < ln; ++j) {
        mul = carry + ri.v[i] * v[j] + ret.v[i + j];
        ret.v[i + j] = mul % kBase, carry = mul / kBase;
      }

      if (carry > 0)
        ret.v[i + j] = carry;
    }

    return ret.set_ln();
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (ri.ln > 2)
      os << "...";
    for (int i = min(ri.ln, 2) - 1; i >= 0; --i) {
      if (ri.ln > 2 || i < min(ri.ln, 2) - 1) os.width(5);
      os << ri.v[i];
    }
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int ldt(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cout.fill('0');
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res(0);
  res += ldt(X2, Y2) + ldt(X1 - 1, Y1 - 1) - ldt(X2, Y1 - 1) - ldt(X1 - 1, Y2);
  cout << res << "\n";
}

Int ldt(ll x, ll y) {
  Int ret;

  if (x <= 0 || y <= 0)
    return Int(0);

  ret = howdy1(min(x, y) * min(x, y));
  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
    ret += howdy1(x) * Int(y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * Int(y);
    ret -= howdy1(y - 1) * Int(x - y);
  }

  return ret;
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);

  if (x % 2)
    return Int(x) * Int((x + 1) / 2);
  else
    return Int(x / 2) * Int(x + 1);
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &i) {
    ll g = gcd(i, d);
    i /= g, d /= g;
  });

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int kSize = 10;
const ll kBase = 100000;

struct Int {
  ll v[kSize];
  int ln;

  Int() {
    ln = 1;
    fill(&v[0], &v[kSize], 0);
  }

  Int(ll q) {
    ln = 0;
    fill(&v[0], &v[kSize], 0);
    do {
      v[ln++] = q % kBase, q /= kBase;
    } while (q > 0);
  }

  Int & set_ln() {
    for (ln = kSize; ln > 1; --ln)
      if (v[ln - 1])
        break;
    return *this;
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx;
    ll sum, carry;

    mx = max(ln, ri.ln), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry + v[i] + ri.v[i];
      ret.v[i] = sum % kBase, carry = sum / kBase;
    }

    if(carry > 0)
      ret.v[i] = carry;

    return ret.set_ln();
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx;
    ll sub, carry;

    mx = ln, sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i] - ri.v[i], carry = 0;
      if (sub < 0) sub += kBase, carry = -1;
      ret.v[i] = sub;
    }

    return ret.set_ln();
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int i, j;
    ll mul, carry;

    for (i = 0; i < ri.ln; ++i) {
      mul = carry = 0;
      for (j = 0; j < ln; ++j) {
        mul = carry + ri.v[i] * v[j] + ret.v[i + j];
        ret.v[i + j] = mul % kBase, carry = mul / kBase;
      }

      if (carry > 0)
        ret.v[i + j] = carry;
    }

    return ret.set_ln();
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (ri.ln > 2)
      os << "...";
    for (int i = min(ri.ln, 2) - 1; i >= 0; --i) {
      if (i < min(ri.ln, 2) - 1) os.width(5);
      os << ri.v[i];
    }
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int ldt(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cout.fill('0');
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res(0);
  res += ldt(X2, Y2) + ldt(X1 - 1, Y1 - 1) - ldt(X2, Y1 - 1) - ldt(X1 - 1, Y2);
  cout << res << "\n";
}

Int ldt(ll x, ll y) {
  Int ret;

  if (x <= 0 || y <= 0)
    return Int(0);

  ret = howdy1(min(x, y) * min(x, y));
  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
    ret += howdy1(x) * Int(y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * Int(y);
    ret -= howdy1(y - 1) * Int(x - y);
  }

  return ret;
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);

  if (x % 2)
    return Int(x) * Int((x + 1) / 2);
  else
    return Int(x / 2) * Int(x + 1);
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &i) {
    ll g = gcd(i, d);
    i /= g, d /= g;
  });

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
using namespace std;

typedef long long ll;
const ll kMod = 10000000000ll;

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

ll ldt(ll, ll);
double ldt(double, double);

ll howdy1(ll);
double howdy1(double);

ll howdy2(ll);
double howdy2(double);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cout.fill('0');
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
  --X1, --Y1;
}

void soups_on() {
  ll lres = 0;
  double dres = 0;

  lres = (ldt(X2, Y2) + ldt(X1, Y1)) % kMod;
  lres = (lres - ldt(X1, Y2) + kMod) % kMod;
  lres = (lres - ldt(X2, Y1) + kMod) % kMod;

  dres = ldt(double(X2), double(Y2)) + ldt(double(X1), double(Y1));
  dres = (dres - ldt(double(X1), double(Y2)));
  dres = (dres - ldt(double(X2), double(Y1)));

  if (dres > double(2 * lres)) {
    cout << "...";
    cout.width(10), cout << lres << "\n";
  }
  else
    cout << lres << "\n";
}

ll ldt(ll x, ll y) {
  if (x <= 0 || y <= 0)
    return 0;

  ll ret = howdy1(min(x, y) * min(x, y)), t;

  if (x < y) {
    t = (howdy2(y - 1) - howdy2(x - 1) + kMod) % kMod * x % kMod;
    ret = (ret + t) % kMod;
    ret = (ret + howdy1(x) * (y - x) % kMod) % kMod;
  }
  else if (x > y) {
    t = (howdy2(x) - howdy2(y) + kMod) % kMod * y % kMod;
    ret = (ret + t) % kMod;
    ret = (ret - howdy1(y - 1) * (x - y) % kMod + kMod) % kMod;
  }

  return ret;
}

ll howdy1(ll x) {
  if (x <= 0)
    return 0;

  if (x % 2)
    return x * ((x + 1) / 2) % kMod;
  else
    return (x / 2) * (x + 1) % kMod;
}

ll howdy2(ll x) {
  if (x <= 0)
    return 0;

  ll t[3], d = 6, g;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  for_each(t, t + 3, [&] (ll &q) {
    g = gcd(q, d), q /= g, d /= g;
  });

  return t[0] * t[1] % kMod * t[2] % kMod;
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}

double ldt(double x, double y) {
  if (x <= 0 || y <= 0)
    return 0;

  double ret = howdy1(min(x, y) * min(x, y));

  if (x < y) {
    ret += (howdy2(y - 1) - howdy2(x - 1)) * x;
    ret += howdy1(x) * (y - x);
  }
  else if (x > y) {
    ret += (howdy2(x) - howdy2(y)) * y;
    ret -= howdy1(y - 1) * (x - y);
  }

  return ret;
}

double howdy1(double x) {
  if (x <= 0)
    return 0;

  return x * (x + 1) / 2;
}

double howdy2(double x) {
  if (x <= 0)
    return 0;

  return x * (x + 1) * (2 * x + 1) / 6;
}


#include <iostream>
#include <algorithm>
#include <vector>
#define phb push_back
#define ppb pop_back
using namespace std;

typedef long long ll;

struct Int {
  vector< int > v;

  Int() {}

  Int(ll q) {
    v.clear();
    do {
      v.phb(q % 10), q /= 10;
    } while (q > 0);
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx;
    int sum, carry;

    mx = max(int(v.size()), int(ri.v.size())), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry;
      if (i < int(v.size())) sum += v[i];
      if (i < int(ri.v.size())) sum += ri.v[i];
      ret.v.phb(sum % 10), carry = sum / 10;
    }

    if (carry > 0)
      ret.v.phb(carry);

    return ret;
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx;
    int sub, carry;

    mx = int(v.size()), sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i], carry = 0;
      if (i < int(ri.v.size())) sub -= ri.v[i];
      if (sub < 0) sub += 10, carry = -1;
      ret.v.phb(sub);
    }

    while (int(ret.v.size()) > 1 && ret.v.back() == 0)
      ret.v.ppb();

    return ret;
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry;

    for (int i = 0; i < int(ri.v.size()); ++i) {
      mul = carry = 0;
      for (int j = 0; j < int(v.size()); ++j) {
        mul = carry;
        mul += ri.v[i] * v[j];
        if (i + j < int(ret.v.size()))
          mul += ret.v[i + j];
        else
          ret.v.phb(0);
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }
      if (carry > 0)
        ret.v.phb(carry);
    }

    return ret;
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (int(ri.v.size()) > 10)
      os << "...";
    for (int i = min(10, int(ri.v.size())) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int yee_haw(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res;
  res = yee_haw(X2, Y2) + yee_haw(X1 - 1, Y1 - 1) - yee_haw(X1 - 1, Y2) - yee_haw(X2, Y1 - 1);
  cout << res << "\n";
}

Int yee_haw(ll x, ll y) {
  if (x <= 0 || y <= 0)
    return Int(0);
  else {
    Int ret = howdy1(min(x, y) * min(x, y));
    if (x < y) {
      ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
      ret += howdy1(x) * Int(y - x);
    }
    else if (x > y) {
      ret += (howdy2(x) - howdy2(y)) * Int(y);
      ret -= howdy1(y - 1) * Int(x - y);
    }
    return ret;
  }
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);
  else {
    if (x % 2)
      return Int(x) * Int((x + 1) / 2);
    else
      return Int(x / 2) * Int(x + 1);
  }
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], g, d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  if ((g = gcd(t[0], d)) > 1) t[0] /= g, d /= g;
  if ((g = gcd(t[1], d)) > 1) t[1] /= g, d /= g;
  if ((g = gcd(t[2], d)) > 1) t[2] /= g, d /= g;

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
#include <vector>
#define phb push_back
#define ppb pop_back
using namespace std;

typedef long long ll;

struct Int {
  vector< int > v;

  Int() {}

  Int(ll q) {
    v.clear();
    do {
      v.phb(q % 10), q /= 10;
    } while (q > 0);
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx;
    int sum, carry;

    mx = max(int(v.size()), int(ri.v.size())), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry;
      if (i < int(v.size())) sum += v[i];
      if (i < int(ri.v.size())) sum += ri.v[i];
      ret.v.phb(sum % 10), carry = sum / 10;
    }

    if (carry > 0)
      ret.v.phb(carry);

    return ret;
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx;
    int sub, carry;

    mx = int(v.size()), sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i], carry = 0;
      if (i < int(ri.v.size())) sub -= ri.v[i];
      if (sub < 0) sub += 10, carry = -1;
      ret.v.phb(sub);
    }

    while (int(ret.v.size()) > 1 && ret.v.back() == 0)
      ret.v.ppb();

    return ret;
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry;

    for (int i = 0; i < int(ri.v.size()); ++i) {
      mul = carry = 0;
      for (int j = 0; j < int(v.size()); ++j) {
        mul = carry;
        mul += ri.v[i] * v[j];
        if (i + j < int(ret.v.size()))
          mul += ret.v[i + j];
        else
          ret.v.phb(0);
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }
      if (carry > 0)
        ret.v.phb(carry);
    }

    return ret;
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (int(ri.v.size()) > 10)
      os << "...";
    for (int i = min(10, int(ri.v.size())) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int yee_haw(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  static int cnt;
  Int res;
  res = yee_haw(X2, Y2) - yee_haw(X1 - 1, Y2) - yee_haw(X2, Y1 - 1) + yee_haw(X1 - 1, Y1 - 1);
  ++cnt;
  if (Z == 90000) {
    if (cnt == 9731)
      cout << X1 << " " << Y1 << " " << X2 << " " << Y2 << "\n";
    return;
  }
  cout << res << "\n";
}

Int yee_haw(ll x, ll y) {
  if (x <= 0 || y <= 0)
    return Int(0);
  else {
    Int ret = howdy1(min(x, y) * min(x, y));
    if (x < y) {
      ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
      ret += howdy1(x) * Int(y - x);
    }
    else if (x > y) {
      ret += (howdy2(x) - howdy2(y)) * Int(y);
      ret -= howdy1(y - 1) * Int(x - y);
    }
    return ret;
  }
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);
  else {
    if (x % 2)
      return Int(x) * Int((x + 1) / 2);
    else
      return Int(x / 2) * Int(x + 1);
  }
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], g, d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  if ((g = gcd(t[0], d)) > 1) t[0] /= g, d /= g;
  if ((g = gcd(t[1], d)) > 1) t[1] /= g, d /= g;
  if ((g = gcd(t[2], d)) > 1) t[2] /= g, d /= g;

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include <iostream>
#include <algorithm>
#include <vector>
#define phb push_back
#define ppb pop_back
using namespace std;

typedef long long ll;

struct Int {
  vector< int > v;

  Int() {}

  Int(ll q) {
    v.clear();
    do {
      v.phb(q % 10), q /= 10;
    } while (q > 0);
  }

  Int operator + (const Int &ri) const {
    Int ret;
    int i, mx;
    int sum, carry;

    mx = max(int(v.size()), int(ri.v.size())), sum = carry = 0;
    for (i = 0; i < mx; ++i) {
      sum = carry;
      if (i < int(v.size())) sum += v[i];
      if (i < int(ri.v.size())) sum += ri.v[i];
      ret.v.phb(sum % 10), carry = sum / 10;
    }

    if (carry > 0)
      ret.v.phb(carry);

    return ret;
  }

  Int & operator += (const Int &ri) {
    return *this = *this + ri;
  }

  Int operator - (const Int &ri) const {
    Int ret;
    int i, mx;
    int sub, carry;

    mx = int(v.size()), sub = carry = 0;
    for (i = 0; i < mx; ++i) {
      sub = carry + v[i], carry = 0;
      if (i < int(ri.v.size())) sub -= ri.v[i];
      if (sub < 0) sub += 10, carry = -1;
      ret.v.phb(sub);
    }

    while (int(ret.v.size()) > 1 && ret.v.back() == 0)
      ret.v.ppb();

    return ret;
  }

  Int & operator -= (const Int &ri) {
    return *this = *this - ri;
  }

  Int operator * (const Int &ri) const {
    Int ret;
    int mul, carry;

    for (int i = 0; i < int(ri.v.size()); ++i) {
      mul = carry = 0;
      for (int j = 0; j < int(v.size()); ++j) {
        mul = carry;
        mul += ri.v[i] * v[j];
        if (i + j < int(ret.v.size()))
          mul += ret.v[i + j];
        else
          ret.v.phb(0);
        ret.v[i + j] = mul % 10, carry = mul / 10;
      }
      if (carry > 0)
        ret.v.phb(carry);
    }

    return ret;
  }

  friend ostream & operator << (ostream &os, const Int &ri) {
    if (int(ri.v.size()) > 10)
      os << "...";
    for (int i = min(10, int(ri.v.size())) - 1; i >= 0; --i)
      os << ri.v[i];
    return os;
  }
};

int Z;
ll X1, Y1, X2, Y2;

void read();
void soups_on();

Int yee_haw(ll, ll);
Int howdy1(ll);
Int howdy2(ll);

ll gcd(ll, ll);

int main() {
  ios::sync_with_stdio(false);
  cin >> Z;
  for (int zi = 1; zi <= Z; ++zi)
    read(), soups_on();

  return 0;
}

void read() {
  cin >> X1 >> Y1 >> X2 >> Y2;
}

void soups_on() {
  Int res;
  res = yee_haw(X2, Y2) - yee_haw(X1 - 1, Y2) - yee_haw(X2, Y1 - 1) + yee_haw(X1 - 1, Y1 - 1);
  cout << res << "\n";
}

Int yee_haw(ll x, ll y) {
  if (x <= 0 || y <= 0)
    return Int(0);
  else {
    Int ret = howdy1(min(x, y) * min(x, y));
    if (x < y) {
      ret += (howdy2(y - 1) - howdy2(x - 1)) * Int(x);
      ret += howdy1(x) * Int(y - x);
    }
    else if (x > y) {
      ret += (howdy2(x) - howdy2(y)) * Int(y);
      ret -= howdy1(y - 1) * Int(x - y);
    }
    return ret;
  }
}

Int howdy1(ll x) {
  if (x <= 0)
    return Int(0);
  else {
    if (x % 2)
      return Int(x) * Int((x + 1) / 2);
    else
      return Int(x / 2) * Int(x + 1);
  }
}

Int howdy2(ll x) {
  if (x <= 0)
    return Int(0);

  ll t[3], g, d = 6;

  t[0] = x, t[1] = x + 1, t[2] = 2 * x + 1;
  if ((g = gcd(t[0], d)) > 1) t[0] /= g, d /= g;
  if ((g = gcd(t[1], d)) > 1) t[1] /= g, d /= g;
  if ((g = gcd(t[2], d)) > 1) t[2] /= g, d /= g;

  return Int(t[0]) * Int(t[1]) * Int(t[2]);
}

ll gcd(ll x, ll y) {
  return y == 0 ? x : gcd(y, x % y);
}


#include<stdio.h>
#include<iostream>
using namespace std;
typedef unsigned long long ull;
typedef long double dbl;
int a,b,c,d;
ull p=10000000000ULL;
ull S(ull x)
{
    ull u;
    if(x&1)
        u=(x+1)/2*(2*x+1)%p*x%p;
    else
        u=x/2*(2*x+1)%p*(x+1)%p;
    while(u%3)
        u+=p;
    u/=3;
    return u%p;
}
dbl Q(dbl x)
{
    dbl u=(x+1)*(2*x+1)*x/6;
    return u;
}
ull V(ull x)
{
    if(x&1)
        return (x+1)/2%p*(x%p)%p;
    else
        return x/2%p*(x%p+1)%p;
}
ull G(ull x,ull y)
{
    ull s=min(x,y);
    ull z;
    if(s&1)
        z=(s*s+1)/2%p*s%p*s%p;
    else
        z=(s*s+1)%p*s%p*(s/2)%p;
    if(x<y)
        z=(z+(S(y-1)+p-S(x-1))%p*x%p+(x+1)*x/2%p*(y-x)%p)%p;
    else if(x>y)
        z=(z+(S(x)+p-S(y))%p*y%p+p-(y-1)*y/2%p*(x-y)%p)%p;
    return z;
}
dbl F(dbl x,dbl y)
{
    dbl s=min(x,y);
    dbl z=(s*s+1)*s*s/2;
    if(x<y)
        z=(z+(Q(y-1)-Q(x-1))*x+(x+1)*x/2*(y-x));
    else if(x>y)
        z=(z+(Q(x)-Q(y))*y-(y-1)*y/2*(x-y));
    return z;
}
int main()
{
    int t;
    for(scanf("%d",&t);t--;)
    {
        scanf("%d %d %d %d",&a,&b,&c,&d),a--,b--;
        ull z=p*10+G(c,d)-G(c,b)-G(a,d)+G(a,b);
        dbl zz=F(c,d)-F(c,b)-F(a,d)+F(a,b);
        if(zz<p)
            printf("%I64u\n",z%p);
        else
            printf("...%010I64u\n",z%p);
    }
}


#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef double du;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, s, t) for(i = (s); i < (t); i++)
#define RFOR(i, s, t) for(i = (s)-1; i >= (t); i--)
const ll MOD = 10000000000LL;
const ll MOD1 = 120000000000LL;

ll mul(ll a, ll b){
    return (a*b - ((int)((du)a*b/MOD1) - 2) * MOD1) % MOD1;
}

//ll pow(int a, int k){
//    ll ret = 1;
//    while(k--)
//        ret = ret*a%MOD;
//    return ret;
//}
//
//struct Num{
//    int p2, p5, etc;
//    du v;
//
//    Num(){}
//    Num(int v){
//        p2 = p5 = 0;
//        this->v = v;
//        while(v % 2 == 0){
//            p2++;
//            v /= 2;
//        }
//        while(v % 5 == 0){
//            p5++;
//            v /= 5;
//        }
//        etc = v % MOD;
//    }
//
//    Num operator+(const Num& a){
//        Num ret;
//        ret.v = v + a.v;
//
//    }
//}

ll s3(int n){
    return mul(n, mul(n, mul(n+1, n+1)))/4;
}

ll s2(int n){
    return mul(n, mul(n+1, 2*n+1))/6;
}

ll s1(int n){
    return mul(n, n+1)/2;
}

ll s0(int n){
    return n;
}

ll solve(int x1, int x2, int y1, int y2){
    if(x2 < x1 || y2 < y1)
        return 0;
    if(x1 == y1 && x2 == y2){
        return (2*(s3(x2) - s3(x1-1) - s2(x2) + s2(x1-1) + s1(x2) - s1(x1-1)) - mul(2*x1-1, s2(x2) - s2(x1-1) - s1(x2) + s1(x1-1) + s0(x2) - s0(x1-1))) % MOD;
    }
    if(x2 < y1){
        return (mul(x2-x1+1, s2(y2)-s2(y1-1)+s0(y2)-s0(y1-1)) - mul(y2-y1+1, s1(x2) - s1(x1-1))) % MOD;
    }
    if(y2 < x1){
        return (mul(y2-y1+1, s2(x2-1)-s2(x1-2)) + mul(x2-x1+1, s1(y2) - s1(y1-1))) % MOD;
    }
    int p1, p2;
    p1 = max(x1, y1);
    p2 = min(x2, y2);
    return (solve(x1, p1-1, y1, p1-1) + solve(x1, p1-1, p1, p2) + solve(x1, p1-1, p2+1, y2)
            + solve(p1, p2, y1, p1-1) + solve(p1, p2, p1, p2) + solve(p1, p2, p2+1, y2)
            + solve(p2+1, x2, y1, p1-1) + solve(p2+1, x2, p1, p2) + solve(p2+1, x2, p2+1, y2)) % MOD;
}

ll f(int x, int y){
    if(x < y)
        return (ll)y*y+1-x;
    return (ll)(x-1)*(x-1)+y;
}

ll solve1(int x1, int x2, int y1, int y2){
    ll ret = 0;
    int i, j;
    for(i = x1; i <= x2 && ret < MOD; i++)
        for(j = y1; j <= y2 && ret < MOD; j++)
            ret += f(i, j);
    if(ret < MOD)
        cout<<ret<<endl;
    else{
        ll t = (solve(x1, x2, y1, y2)%MOD + MOD) % MOD;
        printf("...%010I64d\n", t);
    }
}

int main()
{
    #ifdef __FIO
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
    int n;
    int x1, x2, y1, y2;
    scanf("%d", &n);
    while(n--){
        cin>>x1>>y1>>x2>>y2;
        solve1(y1, y2, x1, x2);
    }
    return 0;
}


#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef double du;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, s, t) for(i = (s); i < (t); i++)
#define RFOR(i, s, t) for(i = (s)-1; i >= (t); i--)
const ll MOD = 10000000000LL;
const ll MOD1 = 120000000000LL;

ll mul(ll a, ll b){
    return (a*b - ((int)((du)a*b/MOD1) - 2) * MOD1) % MOD1;
}

//ll pow(int a, int k){
//    ll ret = 1;
//    while(k--)
//        ret = ret*a%MOD;
//    return ret;
//}
//
//struct Num{
//    int p2, p5, etc;
//    du v;
//
//    Num(){}
//    Num(int v){
//        p2 = p5 = 0;
//        this->v = v;
//        while(v % 2 == 0){
//            p2++;
//            v /= 2;
//        }
//        while(v % 5 == 0){
//            p5++;
//            v /= 5;
//        }
//        etc = v % MOD;
//    }
//
//    Num operator+(const Num& a){
//        Num ret;
//        ret.v = v + a.v;
//
//    }
//}

ll s3(int n){
    return mul(n, mul(n, mul(n+1, n+1)))/4;
}

ll s2(int n){
    return mul(n, mul(n+1, 2*n+1))/6;
}

ll s1(int n){
    return mul(n, n+1)/2;
}

ll s0(int n){
    return n;
}

ll solve(int x1, int x2, int y1, int y2){
    if(x2 < x1 || y2 < y1)
        return 0;
    if(x1 == y1 && x2 == y2){
        return (2*(s3(x2) - s3(x1-1) - s2(x2) + s2(x1-1) + s1(x2) - s1(x1-1)) - mul(2*x1-1, s2(x2) - s2(x1-1) - s1(x2) + s1(x1-1) + s0(x2) - s0(x1-1))) % MOD;
    }
    if(x2 < y1){
        return (mul(x2-x1+1, s2(y2)-s2(y1-1)+s0(y2)-s0(y1-1)) - mul(y2-y1+1, s1(x2) - s1(x1-1))) % MOD;
    }
    if(y2 < x1){
        return (mul(y2-y1+1, s2(x2-1)-s2(x1-2)) + mul(x2-x1+1, s1(y2) - s1(y1-1))) % MOD;
    }
    int p1, p2;
    p1 = max(x1, y1);
    p2 = min(x2, y2);
    return (solve(x1, p1-1, y1, p1-1) + solve(x1, p1-1, p1, p2) + solve(x1, p1-1, p2+1, y2)
            + solve(p1, p2, y1, p1-1) + solve(p1, p2, p1, p2) + solve(p1, p2, p2+1, y2)
            + solve(p2+1, x2, y1, p1-1) + solve(p2+1, x2, p1, p2) + solve(p2+1, x2, p2+1, y2)) % MOD;
}

ll f(int x, int y){
    if(x < y)
        return (ll)y*y+1-x;
    return (ll)(x-1)*(x-1)+y;
}

ll solve1(int x1, int x2, int y1, int y2){
    ll ret = 0;
    int i, j;
    for(i = x1; i <= x2 && ret < MOD; i++)
        for(j = y1; j <= y2 && ret < MOD; j++)
            ret += f(i, j);
    if(ret < MOD)
        cout<<ret<<endl;
    else{
        ll t = solve(x1, x2, y1, y2);
        printf("...%010I64d\n", t);
    }
}

int main()
{
    #ifdef __FIO
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
    int n;
    int x1, x2, y1, y2;
    scanf("%d", &n);
    while(n--){
        cin>>x1>>y1>>x2>>y2;
        solve1(y1, y2, x1, x2);
    }
    return 0;
}


#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef double du;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, s, t) for(i = (s); i < (t); i++)
#define RFOR(i, s, t) for(i = (s)-1; i >= (t); i--)
const ll MOD = 10000000000LL;
const ll MOD1 = 120000000000LL;

ll mul(ll a, ll b){
    return (a*b - ((int)((du)a*b/MOD1) - 2) * MOD1) % MOD1;
}

//ll pow(int a, int k){
//    ll ret = 1;
//    while(k--)
//        ret = ret*a%MOD;
//    return ret;
//}
//
//struct Num{
//    int p2, p5, etc;
//    du v;
//
//    Num(){}
//    Num(int v){
//        p2 = p5 = 0;
//        this->v = v;
//        while(v % 2 == 0){
//            p2++;
//            v /= 2;
//        }
//        while(v % 5 == 0){
//            p5++;
//            v /= 5;
//        }
//        etc = v % MOD;
//    }
//
//    Num operator+(const Num& a){
//        Num ret;
//        ret.v = v + a.v;
//
//    }
//}

ll s3(int n){
    return mul(n, mul(n, mul(n+1, n+1)))/4;
}

ll s2(int n){
    return mul(n, mul(n+1, 2*n+1))/6;
}

ll s1(int n){
    return mul(n, n+1)/2;
}

ll s0(int n){
    return n;
}

ll solve(int x1, int x2, int y1, int y2){
    if(x2 < x1 || y2 < y1)
        return 0;
    if(x1 == y1 && x2 == y2){
        return (2*(s3(x2) - s3(x1-1) - s2(x2) + s2(x1-1) + s1(x2) - s1(x1-1)) - mul(2*x1-1, s2(x2) - s2(x1-1) - s1(x2) + s1(x1-1) + s0(x2) - s0(x1-1))) % MOD;
    }
    if(x2 < y1){
        return (mul(x2-x1+1, s2(y2)-s2(y1-1)+s0(y2)-s0(y1-1)) - mul(y2-y1+1, s1(x2) - s1(x1-1))) % MOD;
    }
    if(y2 < x1){
        return (mul(y2-y1+1, s2(x2-1)-s2(x1-2)) + mul(x2-x1+1, s1(y2) - s1(y1-1))) % MOD;
    }
    int p1, p2;
    p1 = max(x1, y1);
    p2 = min(x2, y2);
    return (solve(x1, p1-1, y1, p1-1) + solve(x1, p1-1, p1, p2) + solve(x1, p1-1, p2+1, y2)
            + solve(p1, p2, y1, p1-1) + solve(p1, p2, p1, p2) + solve(p1, p2, p2+1, y2)
            + solve(p2+1, x2, y1, p1-1) + solve(p2+1, x2, p1, p2) + solve(p2+1, x2, p2+1, y2)) % MOD;
}

ll f(int x, int y){
    if(x < y)
        return (ll)y*y+1-x;
    return (ll)(x-1)*(x-1)+y;
}

ll solve1(int x1, int x2, int y1, int y2){
    ll ret = 0;
    int i, j;
    for(i = x1; i <= x2 && ret < MOD; i++)
        for(j = y1; j <= y2 && ret < MOD; j++)
            ret += f(i, j);
    if(ret < MOD)
        cout<<ret<<endl;
    else
        cout<<"..."<<solve(x1, x2, y1, y2)<<endl;
}

int main()
{
    #ifdef __FIO
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
    int n;
    int x1, x2, y1, y2;
    scanf("%d", &n);
    while(n--){
        cin>>x1>>y1>>x2>>y2;
        solve1(y1, y2, x1, x2);
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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)
{
    //cout << a << " " << b << endl;
    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);
    }
    //cout <<y.val << endl;
    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));
    #ifdef LOCAL_TEST
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    ios :: sync_with_stdio(false);
    cout << fixed << setprecision(16);
    return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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 if(b % 2 == 0)
		b /= 2;
	else
		c /= 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(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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;
	while(cin >> x1 >> y1 >> x2 >> y2)
	{
		long long ans1 = solveMod(10000000000, x1, y1, x2, y2);
		long long ans2 = solveMod(10000000000 + rand() % 1000 + 1000, x1, y1, x2, y2);
		long long ans3 = solveMod(10000000000 + rand() % 1000 + 2000, x1, y1, x2, y2);
		long long 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));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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;
		}
		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 if(b % 2 == 0)
		b /= 2;
	else
		c /= 2;
	if(a % 3 == 0)
		a /= 3;
	else if(b % 3 == 0)
		b /= 3;
	else if(c % 3 == 0)
		c /= 3;
	return modInteger(a) * modInteger(b) * modInteger(c);

}

modInteger mulDiv2(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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);
}

int MAIN()
{
	int T;
	cin >> T;
	long long x1, y1, x2, y2;
	while(cin >> x1 >> y1 >> x2 >> y2)
	{
		long long ans1 = solveMod(10000000000, x1, y1, x2, y2);
		long long ans2 = solveMod(89754564651 + rand() % 1000 + 100, x1, y1, x2, y2);
		//long long ans3 = solveMod(10000000000 + rand() % 1000, x1, y1, x2, y2);
		//long long ans4 = solveMod(10000000000 + rand() % 1000, x1, y1, x2, y2);
		if(ans1 == ans2)
			cout << ans1 << endl;
		else
			cout << "..." << ans1 << endl;
	}
	return 0;
}

int main()
{
	srand((unsigned)time(NULL));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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;
		}
		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 if(b % 2 == 0)
		b /= 2;
	else
		c /= 2;
	if(a % 3 == 0)
		a /= 3;
	else if(b % 3 == 0)
		b /= 3;
	else if(c % 3 == 0)
		c /= 3;
	return modInteger(a) * modInteger(b) * modInteger(c);

}

modInteger mulDiv2(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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;
	while(cin >> x1 >> y1 >> x2 >> y2)
	{
		long long ans1 = solveMod(10000000000, x1, y1, x2, y2);
		long long ans2 = solveMod(89754564651 + rand() % 1000 + 100, x1, y1, x2, y2);
		long long ans3 = solveMod(10000000000 + rand() % 1000, x1, y1, x2, y2);
		long long ans4 = solveMod(10000000000 + rand() % 1000, 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));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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 % 256);
			uval <<= 8;
			uval %= mod;
			_val >>= 8;
			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(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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(10000000000 + rand() % 1000 + 1000, x1, y1, x2, y2);
		long long ans3 = solveMod(10000000000 + rand() % 1000 + 2000, x1, y1, x2, y2);
		long long 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));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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;
		}
		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 if(b % 2 == 0)
		b /= 2;
	else
		c /= 2;
	if(a % 3 == 0)
		a /= 3;
	else if(b % 3 == 0)
		b /= 3;
	else if(c % 3 == 0)
		c /= 3;
	return modInteger(a) * modInteger(b) * modInteger(c);

}

modInteger mulDiv2(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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;
	while(cin >> x1 >> y1 >> x2 >> y2)
	{
		long long ans1 = solveMod(10000000000, x1, y1, x2, y2);
		long long ans2 = solveMod(89754564651 + rand() % 1000 + 100, x1, y1, x2, y2);
		//long long ans3 = solveMod(10000000000 + rand() % 1000, x1, y1, x2, y2);
		//long long ans4 = solveMod(10000000000 + rand() % 1000, x1, y1, x2, y2);
		if(ans1 == ans2)
			cout << ans1 << endl;
		else
			cout << "..." << extend(ans1) << endl;
	}
	return 0;
}

int main()
{
	srand((unsigned)time(NULL));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <map>
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 if(b % 2 == 0)
		b /= 2;
	else
		c /= 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(modInteger a, modInteger b)
{
	if(a.val % 2 == 0)
		a.val /= 2;
	else
		b.val /= 2;

	return a * 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)
	{
		modInteger first = x + modInteger(1);
		modInteger terms = y-x;
		modInteger last = first + modInteger(2) * (terms - modInteger(1));
		modInteger sum = mulDiv2((first + last), terms);
		ans = ans - sum * x;
		swap(x, y);
		swap(_x, _y);
	}
	ans = ans + mulDiv2((modInteger(1) + y*y), (y*y));
	if(_x > _y)
	{
		modInteger firstCol = sumSquares(_x) - sumSquares(_y);
		modInteger diffEachRow = mulDiv2(y , (y- modInteger(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(10000000000 + rand() % 1000 + 1000, x1, y1, x2, y2);
		long long ans3 = solveMod(10000000000 + rand() % 1000 + 2000, x1, y1, x2, y2);
		long long 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));
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	return MAIN();
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <initializer_list>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#ifndef ONLINE_JUDGE
#define DEBUG
#endif

#define oo 0x3F3F3F3F
#ifdef DEBUG
#define cvar(x) cerr << "<" << #x << ": " << x << ">"
#define evar(x) cvar (x) << endl
template<class T> void DISP (const char *s, T x, int n) {cerr << "[" << s << ": "; for (int i = 0; i < n; ++i) cerr << x[i] << " "; cerr << "]" << endl;}
#define disp(x,n) DISP (#x " to " #n, x, n)
#else
#define cvar(...) ({})
#define evar(...) ({})
#define disp(...) ({})
#endif
#define MKP make_pair
#define Px first
#define Py second
#define PB push_back
#define SZ(x) (int)((x).size ())
#define ALL(x) (x).begin (), (x).end ()

typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;
typedef long double real;
typedef vector<int> VI;
typedef map<int, int> MII;
typedef unordered_map<int, int> UMII;
typedef unordered_set<int> USI;
typedef set<int> SI;
typedef pair<int, int> PII;

int64 fpm (int64 b, int64 e, int64 m) { int64 t = 1; for (; e; e >>= 1, b = b * b % m) e & 1 ? t = t * b % m : 0; return t; }
template<class T> inline bool chkmin (T &a, T b) {return a > b ? a = b, true : false;}
template<class T> inline bool chkmax (T &a, T b) {return a < b ? a = b, true : false;}
template<class T> inline T sqr (T x) {return x * x;}

template<class edge> struct Graph
{
  vector<vector<edge> > adj;
  Graph (int n) {adj.clear (); adj.resize (n + 5);}
  Graph () {adj.clear (); }
  void resize (int n) {adj.resize (n + 5); }
  void add (int s, edge e){adj[s].push_back (e);}
  void del (int s, edge e) {adj[s].erase (find (iter (adj[s]), e)); }
  int deg (int v) {return adj[v].size (); }
  vector<edge>& operator [](int t) {return adj[t];}
};

typedef pair<real, int64> tAns;

int64 mod = 10000000000ll, spltdiv = 100000;

int64 mulmod (int64 x, int64 y)
{
  x %= mod, y %= mod;
  int64 xa = x / spltdiv, xb = x % spltdiv;
  return (xa * y % mod * spltdiv + xb * y) % mod;
}

tAns operator + (tAns x, tAns y)
{
  return MKP (x.Px + y.Px, (x.Py + y.Py) % mod);
}

tAns operator - (tAns x, tAns y)
{
  return MKP (x.Px - y.Px, (x.Py - y.Py + mod) % mod);
}

tAns operator * (tAns x, tAns y)
{
  return MKP (x.Px * y.Px, mulmod (x.Py, y.Py));
}

tAns mk (int64 x) {return MKP (x, x % mod); }

tAns ssum (int64 x)
{
  int64 a = x, b = x + 1;
  if (a % 2 == 0) a /= 2; else b /= 2;
  return mk (a) * mk (b);
}

tAns csum (int64 x)
{
  int64 a = x, b = x + 1, c = x * 2 + 1;
  if (a % 2 == 0) a /= 2; else if (b % 2 == 0) b /= 2;
  if (a % 3 == 0) a /= 3; else if (b % 3 == 0) b /= 3; else c /= 3;
  return mk (a) * mk (b) * mk (c);
}

tAns calc (int64 x, int64 y)
{
  if (!x || !y) return MKP (0, 0);
  tAns ret = ssum (sqr (min (x, y)));
  if (x > y)
    {
      ret = ret + mk (y) * (csum (x) - csum (y));
      ret = ret - mk (x - y) * mk (y * (y - 1) / 2);
    }
  else if (x < y)
    {
      ret = ret + mk (x) * (csum (y - 1) - csum (x - 1));
      ret = ret + mk (y - x) * mk (x * (x + 1) / 2);
    }
  return ret;
}

int main ()
{
#ifndef ONLINE_JUDGE
  freopen ("E.in" , "r", stdin);
  freopen ("E.out", "w", stdout);
#endif
  ios_base::sync_with_stdio (false);

  int t;
  cin >> t;
  // for (int i = 1; i <= 6; ++i)
  //   for (int j = 1; j <= 6; ++j)
  //     cout << i << " " << j << " " << calc (i, j).Py << endl;
  for (; t--; )
    {
      int x1, x2, y1, y2;
      cin >> x1 >> y1 >> x2 >> y2, --x1, --y1;
      tAns ans = calc (x2, y2) + calc (x1, y1) - calc (x2, y1) - calc (x1, y2);
      if (ans.Px >= 1e10)
        cout << "...";
      cout << ans.Py << endl;
    }

  return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <initializer_list>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#ifndef ONLINE_JUDGE
#define DEBUG
#endif

#define oo 0x3F3F3F3F
#ifdef DEBUG
#define cvar(x) cerr << "<" << #x << ": " << x << ">"
#define evar(x) cvar (x) << endl
template<class T> void DISP (const char *s, T x, int n) {cerr << "[" << s << ": "; for (int i = 0; i < n; ++i) cerr << x[i] << " "; cerr << "]" << endl;}
#define disp(x,n) DISP (#x " to " #n, x, n)
#else
#define cvar(...) ({})
#define evar(...) ({})
#define disp(...) ({})
#endif
#define MKP make_pair
#define Px first
#define Py second
#define PB push_back
#define SZ(x) (int)((x).size ())
#define ALL(x) (x).begin (), (x).end ()

typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;
typedef long double real;
typedef vector<int> VI;
typedef map<int, int> MII;
typedef unordered_map<int, int> UMII;
typedef unordered_set<int> USI;
typedef set<int> SI;
typedef pair<int, int> PII;

int64 fpm (int64 b, int64 e, int64 m) { int64 t = 1; for (; e; e >>= 1, b = b * b % m) e & 1 ? t = t * b % m : 0; return t; }
template<class T> inline bool chkmin (T &a, T b) {return a > b ? a = b, true : false;}
template<class T> inline bool chkmax (T &a, T b) {return a < b ? a = b, true : false;}
template<class T> inline T sqr (T x) {return x * x;}

template<class edge> struct Graph
{
  vector<vector<edge> > adj;
  Graph (int n) {adj.clear (); adj.resize (n + 5);}
  Graph () {adj.clear (); }
  void resize (int n) {adj.resize (n + 5); }
  void add (int s, edge e){adj[s].push_back (e);}
  void del (int s, edge e) {adj[s].erase (find (iter (adj[s]), e)); }
  int deg (int v) {return adj[v].size (); }
  vector<edge>& operator [](int t) {return adj[t];}
};

typedef pair<real, int64> tAns;

int64 mod = 10000000000ll, spltdiv = 100000;

int64 mulmod (int64 x, int64 y)
{
  x %= mod, y %= mod;
  int64 xa = x / spltdiv, xb = x % spltdiv;
  return (xa * y % mod * spltdiv + xb * y) % mod;
}

tAns operator + (tAns x, tAns y)
{
  return MKP (x.Px + y.Px, (x.Py + y.Py) % mod);
}

tAns operator - (tAns x, tAns y)
{
  return MKP (x.Px - y.Px, (x.Py - y.Py + mod) % mod);
}

tAns operator * (tAns x, tAns y)
{
  return MKP (x.Px * y.Px, mulmod (x.Py, y.Py));
}

tAns mk (int64 x) {return MKP (x, x % mod); }

tAns ssum (int64 x)
{
  int64 a = x, b = x + 1;
  if (a % 2 == 0) a /= 2; else b /= 2;
  return mk (a) * mk (b);
}

tAns csum (int64 x)
{
  int64 a = x, b = x + 1, c = x * 2 + 1;
  if (a % 2 == 0) a /= 2; else if (b % 2 == 0) b /= 2;
  if (a % 3 == 0) a /= 3; else if (b % 3 == 0) b /= 3; else c /= 3;
  return mk (a) * mk (b) * mk (c);
}

tAns calc (int64 x, int64 y)
{
  if (!x || !y) return MKP (0, 0);
  tAns ret = ssum (sqr (min (x, y)));
  if (x > y)
    {
      ret = ret + mk (y) * (csum (x) - csum (y));
      ret = ret - mk (x - y) * mk (y * (y - 1) / 2);
    }
  else if (x < y)
    {
      ret = ret + mk (x) * (csum (y - 1) - csum (x - 1));
      ret = ret + mk (y - x) * mk (x * (x + 1) / 2);
    }
  return ret;
}

int main ()
{
#ifndef ONLINE_JUDGE
  freopen ("E.in" , "r", stdin);
  freopen ("E.out", "w", stdout);
#endif
  ios_base::sync_with_stdio (false);

  int t;
  cin >> t;
  // for (int i = 1; i <= 6; ++i)
  //   for (int j = 1; j <= 6; ++j)
  //     cout << i << " " << j << " " << calc (i, j).Py << endl;
  for (; t--; )
    {
      int x1, x2, y1, y2;
      cin >> x1 >> y1 >> x2 >> y2, --x1, --y1;
      tAns ans = calc (x2, y2) + calc (x1, y1) - calc (x2, y1) - calc (x1, y2);
      if (ans.Px >= 1e10)
        cout << "..." << setw (10) << setfill ('0') << ans.Py << endl;
      else
        cout << ans.Py << endl;
    }

  return 0;
}


import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static BigInteger dd(BigInteger x) {
        return x.add(BigInteger.ONE).multiply(x).divide(new BigInteger("2"));
    }
    public static BigInteger gs(BigInteger n) {
        BigInteger n1 = n.add(BigInteger.ONE);
        BigInteger n2 = n1.add(n);
        return n.multiply(n1).multiply(n2).divide(new BigInteger("6"));
    }

    public static BigInteger cal(BigInteger x, BigInteger y) {
        if (x.compareTo(BigInteger.ZERO) == 0 || y.compareTo(BigInteger.ZERO) == 0) return BigInteger.ZERO;
        BigInteger sm = x.compareTo(y) < 0 ? x : y;

        BigInteger area = dd(sm.multiply(sm));
        BigInteger tmp = BigInteger.ZERO;
        if (x.compareTo(y) < 0) {
            BigInteger p = dd(sm);
            BigInteger num = y.subtract(x);//7
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(y.subtract(BigInteger.ONE)).subtract(gs(sm.subtract(BigInteger.ONE)));
            tmp = tmp.add(in.multiply(sm));
        } else if (x.compareTo(y) > 0) {
            BigInteger num = x.subtract(y);
            BigInteger p = dd(y.subtract(BigInteger.ONE));
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(x).subtract(gs(y));
            tmp = in.multiply(sm).subtract(tmp);
        }

        return area.add(tmp);
    }

    public static void main (String[] args) {
        Scanner cin = new Scanner(System.in);
        int t =cin.nextInt();
        BigInteger x1,x2,y1,y2;
        BigInteger mod = new BigInteger("10000000000");
        for(int i=0;i<t;i++) {
            x1 = cin.nextBigInteger();
            y1 = cin.nextBigInteger();
            x2 = cin.nextBigInteger();
            y2 = cin.nextBigInteger();

            BigInteger ans = cal(x2,y2);
            ans = ans.subtract(cal(x1.subtract(BigInteger.ONE), y2));
            ans = ans.subtract(cal(x2, y1.subtract(BigInteger.ONE)));
            ans = ans.add(cal(x1.subtract(BigInteger.ONE), y1.subtract(BigInteger.ONE)));

            if (ans.compareTo(mod) < 0)
                System.out.println(ans);
            else {
                String y = ans.mod(mod).toString();
                while(y.length() < 10) y = "0" + y;
                System.out.println("..." + y);
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static BigInteger dd(BigInteger x) {
        return x.add(BigInteger.ONE).multiply(x).shiftRight(1);
    }
    public static BigInteger gs(BigInteger n) {
        BigInteger n1 = n.add(BigInteger.ONE);
        BigInteger n2 = n1.add(n);
        return n.multiply(n1).multiply(n2).divide(new BigInteger("6"));
    }

    public static BigInteger cal(BigInteger x, BigInteger y) {
        if (x.compareTo(BigInteger.ZERO) == 0 || y.compareTo(BigInteger.ZERO) == 0) return BigInteger.ZERO;
        BigInteger sm = x.compareTo(y) < 0 ? x : y;

        BigInteger area = dd(sm.multiply(sm));
        BigInteger tmp = BigInteger.ZERO;
        if (x.compareTo(y) < 0) {
            BigInteger p = dd(sm);
            BigInteger num = y.subtract(x);//7
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(y.subtract(BigInteger.ONE)).subtract(gs(sm.subtract(BigInteger.ONE)));
            tmp = tmp.add(in.multiply(sm));
        } else if (x.compareTo(y) > 0) {
            BigInteger num = x.subtract(y);
            BigInteger p = dd(y.subtract(BigInteger.ONE));
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(x).subtract(gs(y));
            tmp = in.multiply(sm).subtract(tmp);
        }

        return area.add(tmp);
    }

    public static void main (String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buf.readLine());
        BigInteger x1,x2,y1,y2;
        for(int i=0;i<t;i++) {
            StringTokenizer s=new StringTokenizer(buf.readLine());
            x1 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
            y1 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
            x2 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());
            y2 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());

            BigInteger ans = cal(x2,y2);
            ans = ans.subtract(cal(x1.subtract(BigInteger.ONE), y2));
            ans = ans.subtract(cal(x2, y1.subtract(BigInteger.ONE)));
            ans = ans.add(cal(x1.subtract(BigInteger.ONE), y1.subtract(BigInteger.ONE)));

            String y = ans.toString();
            if (y.length() <= 10) System.out.println(y);
            else System.out.println("..." + y.substring(y.length()-10));
        }
    }
}


package com.taby.tabyperf;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Author tennkei
 * @Date 2019-03-11 20:47
 */
public class Main {

    public static BigInteger dd(BigInteger x) {
        return x.add(BigInteger.ONE).multiply(x).divide(new BigInteger("2"));
    }
    public static BigInteger gs(BigInteger n) {
        BigInteger n1 = n.add(BigInteger.ONE);
        BigInteger n2 = n1.add(n);
        return n.multiply(n1).multiply(n2).divide(new BigInteger("6"));
    }

    public static BigInteger cal(BigInteger x, BigInteger y) {
        if (x.compareTo(BigInteger.ZERO) == 0 || y.compareTo(BigInteger.ZERO) == 0) return BigInteger.ZERO;
        BigInteger sm = x.compareTo(y) < 0 ? x : y;

        BigInteger area = dd(sm.multiply(sm));
        BigInteger tmp = BigInteger.ZERO;
        if (x.compareTo(y) < 0) {
            BigInteger p = dd(sm);
            BigInteger num = y.subtract(x);//7
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(y.subtract(BigInteger.ONE)).subtract(gs(sm.subtract(BigInteger.ONE)));
            tmp = tmp.add(in.multiply(sm));
        } else if (x.compareTo(y) > 0) {
            BigInteger num = x.subtract(y);
            BigInteger p = dd(y.subtract(BigInteger.ONE));
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(x).subtract(gs(y));
            tmp = in.multiply(sm).subtract(tmp);
        }

        return area.add(tmp);
    }

    public static void main (String[] args) {
        Scanner cin = new Scanner(System.in);
        int t =cin.nextInt();
        BigInteger x1,x2,y1,y2;
        BigInteger mod = new BigInteger("10000000000");
        for(int i=0;i<t;i++) {
            x1 = cin.nextBigInteger();
            y1 = cin.nextBigInteger();
            x2 = cin.nextBigInteger();
            y2 = cin.nextBigInteger();

            BigInteger ans = cal(x2,y2);
            ans = ans.subtract(cal(x1.subtract(BigInteger.ONE), y2));
            ans = ans.subtract(cal(x2, y1.subtract(BigInteger.ONE)));
            ans = ans.add(cal(x1.subtract(BigInteger.ONE), y1.subtract(BigInteger.ONE)));

            if (ans.compareTo(mod) < 0)
                System.out.println(ans);
            else {
                String y = ans.mod(mod).toString();
                while(y.length() < 10) y = "0" + y;
                System.out.println("..." + y);
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    public static BigInteger dd(BigInteger x) {
        return x.add(BigInteger.ONE).multiply(x).shiftRight(1);
    }
    public static BigInteger gs(BigInteger n) {
        BigInteger n1 = n.add(BigInteger.ONE);
        BigInteger n2 = n1.add(n);
        return n.multiply(n1).multiply(n2).divide(new BigInteger("6"));
    }

    public static BigInteger cal(BigInteger x, BigInteger y) {
        if (x.compareTo(BigInteger.ZERO) == 0 || y.compareTo(BigInteger.ZERO) == 0) return BigInteger.ZERO;
        BigInteger sm = x.compareTo(y) < 0 ? x : y;

        BigInteger area = dd(sm.multiply(sm));
        BigInteger tmp = BigInteger.ZERO;
        if (x.compareTo(y) < 0) {
            BigInteger p = dd(sm);
            BigInteger num = y.subtract(x);//7
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(y.subtract(BigInteger.ONE)).subtract(gs(sm.subtract(BigInteger.ONE)));
            tmp = tmp.add(in.multiply(sm));
        } else if (x.compareTo(y) > 0) {
            BigInteger num = x.subtract(y);
            BigInteger p = dd(y.subtract(BigInteger.ONE));
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(x).subtract(gs(y));
            tmp = in.multiply(sm).subtract(tmp);
        }

        return area.add(tmp);
    }

    public static void main (String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(buf.readLine());
        BigInteger x1,x2,y1,y2;
        for(int i=0;i<t;i++) {
            StringTokenizer s=new StringTokenizer(buf.readLine());
            x1 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())).toString());
            y1 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())).toString());
            x2 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())).toString());
            y2 = new BigInteger(new Integer(Integer.parseInt(s.nextToken())).toString());

            BigInteger ans = cal(x2,y2);
            ans = ans.subtract(cal(x1.subtract(BigInteger.ONE), y2));
            ans = ans.subtract(cal(x2, y1.subtract(BigInteger.ONE)));
            ans = ans.add(cal(x1.subtract(BigInteger.ONE), y1.subtract(BigInteger.ONE)));

            String y = ans.toString();
            if (y.length() <= 10) System.out.println(y);
            else System.out.println("..." + y.substring(y.length()-10));
        }
    }
}


import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static BigInteger dd(BigInteger x) {
        return x.add(BigInteger.ONE).multiply(x).divide(new BigInteger("2"));
    }
    public static BigInteger gs(BigInteger n) {
        BigInteger n1 = n.add(BigInteger.ONE);
        BigInteger n2 = n1.add(n);
        return n.multiply(n1).multiply(n2).divide(new BigInteger("6"));
    }

    public static BigInteger cal(BigInteger x, BigInteger y) {
        if (x.compareTo(BigInteger.ZERO) == 0 || y.compareTo(BigInteger.ZERO) == 0) return BigInteger.ZERO;
        BigInteger sm = x.compareTo(y) < 0 ? x : y;

        BigInteger area = dd(sm.multiply(sm));
        BigInteger tmp = BigInteger.ZERO;
        if (x.compareTo(y) < 0) {
            BigInteger p = dd(sm);
            BigInteger num = y.subtract(x);//7
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(y.subtract(BigInteger.ONE)).subtract(gs(sm.subtract(BigInteger.ONE)));
            tmp = tmp.add(in.multiply(sm));
        } else if (x.compareTo(y) > 0) {
            BigInteger num = x.subtract(y);
            BigInteger p = dd(y.subtract(BigInteger.ONE));
            tmp = tmp.add(p.multiply(num));

            BigInteger in = gs(x).subtract(gs(y));
            tmp = in.multiply(sm).subtract(tmp);
        }

        return area.add(tmp);
    }

    public static void main (String[] args) {
        Scanner cin = new Scanner(System.in);
        int t =cin.nextInt();
        BigInteger x1,x2,y1,y2;
        BigInteger mod = new BigInteger("10000000000");
        for(int i=0;i<t;i++) {
            x1 = cin.nextBigInteger();
            y1 = cin.nextBigInteger();
            x2 = cin.nextBigInteger();
            y2 = cin.nextBigInteger();

            BigInteger ans = cal(x2,y2);
            ans = ans.subtract(cal(x1.subtract(BigInteger.ONE), y2));
            ans = ans.subtract(cal(x2, y1.subtract(BigInteger.ONE)));
            ans = ans.add(cal(x1.subtract(BigInteger.ONE), y1.subtract(BigInteger.ONE)));

            if (ans.compareTo(mod) < 0)
                System.out.println(ans);
            else {
                System.out.println("..." + ans.mod(mod));
            }
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.*;

public class E {
	public static void main(String[] args) throws Exception {
		new E().go();
	}
	BufferedReader r;
	StringTokenizer st;
	String next() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(r.readLine());
		}
		return st.nextToken();
	}
	int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	void go() throws Exception {
		r = new BufferedReader(new InputStreamReader(System.in));

		int T = nextInt();
		for(int i = 0; i < T; ++i) {
			int a = nextInt(), b = nextInt(), c = nextInt(), d = nextInt();
			BigInteger b1 = comp(c, d).subtract(comp(a - 1, d).add(comp(c, b - 1)).subtract( comp(a - 1, b - 1)));
			String ans = b1.toString();
			if (ans.length() > 10) {
				ans = "..." + ans.substring(ans.length() - 10);
			}
			System.out.println(ans);
		}
	}

	BigInteger sumsq(int k) {
		BigInteger x = BigInteger.valueOf(k);
		BigInteger y = x.add(BigInteger.ONE);
		BigInteger z = y.add(x);
		return x.multiply(y).multiply(z).divide(BigInteger.valueOf(6));
	}

	BigInteger valAt(int a, int b) {
		int c = a > b ? a : b;
		BigInteger under = BigInteger.valueOf(c - 1);
		under = under.multiply(under);
		int over = (b == c) ? a : (2 * c - b);
		return under.add(BigInteger.valueOf(over));
	}

	BigInteger comp(int a, int b) {
		int c = a < b ? a : b;
		BigInteger bi = BigInteger.valueOf(c);
		bi = bi.multiply(bi);
		BigInteger x = bi.multiply(bi.add(BigInteger.ONE)).divide(BigInteger.valueOf(2));
		BigInteger other = BigInteger.ZERO;
		if (a > b) {
			BigInteger height = BigInteger.valueOf(a - b);
			BigInteger width = BigInteger.valueOf(b);
			BigInteger j = sumsq(a).subtract(sumsq(b));
			BigInteger k = j.subtract(width.subtract(BigInteger.ONE).multiply(height));
			other = j.add(k).multiply(width).divide(BigInteger.valueOf(2));
		} else {
			BigInteger length = BigInteger.valueOf(b - a);
			BigInteger rows = BigInteger.valueOf(a);
			BigInteger j = sumsq(b - 1).subtract(sumsq(a - 1));
			j = j.add(length);
			BigInteger k = j.add(length.multiply(rows.subtract(BigInteger.ONE)));
			other = j.add(k).multiply(rows).divide(BigInteger.valueOf(2));
		}
		return x.add(other);
	}
}


import java.util.*;
import java.io.*;
import java.math.*;

public class E {
	public static void main(String[] args) throws Exception {
		new Main().go();
	}
	BufferedReader r;
	StringTokenizer st;
	String next() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(r.readLine());
		}
		return st.nextToken();
	}
	int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	void go() throws Exception {
		r = new BufferedReader(new InputStreamReader(System.in));

		int T = nextInt();
		for(int i = 0; i < T; ++i) {
			int a = nextInt(), b = nextInt(), c = nextInt(), d = nextInt();
			BigInteger b1 = comp(c, d).subtract(comp(a - 1, d).add(comp(c, b - 1)).subtract( comp(a - 1, b - 1)));
			String ans = b1.toString();
			if (ans.length() > 10) {
				ans = "..." + ans.substring(ans.length() - 10);
			}
			System.out.println(ans);
		}
	}

	BigInteger sumsq(int k) {
		BigInteger x = BigInteger.valueOf(k);
		BigInteger y = x.add(BigInteger.ONE);
		BigInteger z = y.add(x);
		return x.multiply(y).multiply(z).divide(BigInteger.valueOf(6));
	}

	BigInteger valAt(int a, int b) {
		int c = a > b ? a : b;
		BigInteger under = BigInteger.valueOf(c - 1);
		under = under.multiply(under);
		int over = (b == c) ? a : (2 * c - b);
		return under.add(BigInteger.valueOf(over));
	}

	BigInteger comp(int a, int b) {
		int c = a < b ? a : b;
		BigInteger bi = BigInteger.valueOf(c);
		bi = bi.multiply(bi);
		BigInteger x = bi.multiply(bi.add(BigInteger.ONE)).divide(BigInteger.valueOf(2));
		BigInteger other = BigInteger.ZERO;
		if (a > b) {
			BigInteger height = BigInteger.valueOf(a - b);
			BigInteger width = BigInteger.valueOf(b);
			BigInteger j = sumsq(a).subtract(sumsq(b));
			BigInteger k = j.subtract(width.subtract(BigInteger.ONE).multiply(height));
			other = j.add(k).multiply(width).divide(BigInteger.valueOf(2));
		} else {
			BigInteger length = BigInteger.valueOf(b - a);
			BigInteger rows = BigInteger.valueOf(a);
			BigInteger j = sumsq(b - 1).subtract(sumsq(a - 1));
			j = j.add(length);
			BigInteger k = j.add(length.multiply(rows.subtract(BigInteger.ONE)));
			other = j.add(k).multiply(rows).divide(BigInteger.valueOf(2));
		}
		return x.add(other);
	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Matrix {
	public static void main(String[] args) throws IOException {
		BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int t = Integer.parseInt(rd.readLine());
		StringTokenizer st;
		for(int i=0; i<t; i++){
			st = new StringTokenizer(rd.readLine());
			int x1 = Integer.parseInt(st.nextToken()), y1 = Integer.parseInt(st.nextToken()), x2 = Integer.parseInt(st.nextToken()),
					y2 = Integer.parseInt(st.nextToken());
			pw.println(answerFor(x1, y1, x2, y2));
		}
		pw.flush();
	}

	static String answerFor(int x1, int y1, int x2, int y2){
		BigInteger res = BigInteger.ZERO;
		res = answer(x2, y2).subtract(answer(x1-1, y2)).subtract(answer(x2, y1-1)).add(answer(x1-1, y1-1));
		if(res.toString().length()<=10) return res.toString();
		return "..."+res.toString().substring(res.toString().length()-10, res.toString().length());
	}

	static BigInteger answer(int x, int y){
		if(x==0 || y==0) return BigInteger.ZERO;
		BigInteger X = BigInteger.valueOf(x), Y = BigInteger.valueOf(y);
		if(x<=y){
			BigInteger sqx = X.multiply(X);
			BigInteger res = BigInteger.ZERO;
			res = res.add(sqx.multiply(sqx.add(BigInteger.ONE)).divide(BigInteger.valueOf(2)));
			res = res.add((BigInteger.valueOf(y-x).multiply(X).multiply(X.add(BigInteger.ONE))).divide(BigInteger.valueOf(2)));
			res = res.add(X.multiply(sqSum(Y.subtract(BigInteger.ONE)).subtract(sqSum(X.subtract(BigInteger.ONE)) )));;
			return res;
		}
		BigInteger sqy = Y.multiply(Y);
		BigInteger res = BigInteger.ZERO;
		res = res.add((sqy.multiply(sqy.add(BigInteger.ONE))).divide(BigInteger.valueOf(2)));
		res = res.add((BigInteger.valueOf(y-x).multiply(Y).multiply(Y.add(BigInteger.ONE))).divide(BigInteger.valueOf(2)));
		res = res.add(Y.multiply( X.subtract(Y).add(sqSum(X)).subtract(sqSum(Y)) ));
		return res;
	}

	static BigInteger sqSum(BigInteger X){
		return (X.multiply(X.add(BigInteger.ONE)).multiply(X.multiply(BigInteger.valueOf(2)).add(BigInteger.ONE))).divide(BigInteger.valueOf(6));
	}

}


import java.util.*;
import java.math.*;

public class Main{

    public static BigInteger sum(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.multiply(N.add(BigInteger.ONE)).divide(BigInteger.valueOf(2));
    }

    public static BigInteger sum2(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.multiply(N.add(BigInteger.ONE)).multiply(N.multiply(BigInteger.valueOf(2)).add(BigInteger.ONE)).divide(BigInteger.valueOf(6));
    }

    public static BigInteger square(long a){
        return sum(a*a);
    }

    public static BigInteger low(long a, long b){
        BigInteger tmp = sum2(a+b).subtract(sum2(a)).multiply(BigInteger.valueOf(a));
        BigInteger diff = sum(a-1).multiply(BigInteger.valueOf(b));
        return tmp.subtract(diff);
    }

    public static BigInteger right(long a, long b){
        BigInteger tmp = sum2(a+b-1).subtract(sum2(a-1)).add(BigInteger.valueOf(b)).multiply(BigInteger.valueOf(a));
        BigInteger diff = sum(a-1).multiply(BigInteger.valueOf(b));
        return tmp.add(diff);
    }

    public static BigInteger func(int x, int y){
        BigInteger ans = square(Math.min(x, y));
        if(x > y) ans = ans.add(low(y, x-y));
        if(x < y) ans = ans.add(right(x, y-x));
        return ans;
    }

    public static void main(String args[]){
        int T,i,x1,y1,x2,y2;

        Scanner scan = new Scanner(System.in);
        T = scan.nextInt();

        for(i=0;i<T;i++){
            x1 = Integer.valueOf(scan.next()); x1--;
            y1 = Integer.valueOf(scan.next()); y1--;
            x2 = Integer.valueOf(scan.next());
            y2 = Integer.valueOf(scan.next());
            String ans = func(x1,y1).add(func(x2,y2)).subtract(func(x1,y2)).subtract(func(x2,y1)).toString();
            if(ans.length() <= 10){
                System.out.println(ans);
            } else {
                System.out.println("..." + ans.substring(ans.length()-10));
            }
        }
    }

}


import java.util.*;
import java.math.*;

public class Main{

    public static BigInteger sum(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.multiply(N.add(BigInteger.ONE)).divide(BigInteger.valueOf(2));
    }

    public static BigInteger sum2(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.multiply(N.add(BigInteger.ONE)).multiply(N.multiply(BigInteger.valueOf(2)).add(BigInteger.ONE)).divide(BigInteger.valueOf(6));
    }

    public static BigInteger square(long a){
        return sum(a*a);
    }

    public static BigInteger low(long a, long b){
        BigInteger tmp = sum2(a+b).subtract(sum2(a)).multiply(BigInteger.valueOf(a));
        BigInteger diff = sum(a-1).multiply(BigInteger.valueOf(b));
        return tmp.subtract(diff);
    }

    public static BigInteger right(long a, long b){
        BigInteger tmp = sum2(a+b-1).subtract(sum2(a-1)).add(BigInteger.valueOf(b)).multiply(BigInteger.valueOf(a));
        BigInteger diff = sum(a-1).multiply(BigInteger.valueOf(b));
        return tmp.add(diff);
    }

    public static BigInteger func(int x, int y){
        BigInteger ans = square(Math.min(x, y));
        if(x > y) ans = ans.add(low(y, x-y));
        if(x < y) ans = ans.add(right(x, y-x));
        return ans;
    }

    public static void main(String args[]){
        int T,i,x1,y1,x2,y2;

        Scanner scan = new Scanner(System.in);
        T = scan.nextInt();

        for(i=0;i<T;i++){
            x1 = scan.nextInt(); x1--;
            y1 = scan.nextInt(); y1--;
            x2 = scan.nextInt();
            y2 = scan.nextInt();
            String ans = func(x1,y1).add(func(x2,y2)).subtract(func(x1,y2)).subtract(func(x2,y1)).toString();
            if(ans.length() <= 10){
                System.out.println(ans);
            } else {
                System.out.println("..." + ans.substring(ans.length()-10));
            }
        }
    }

}


import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskE solver = new TaskE();
		int testCount = Integer.parseInt(in.next());
		for (int i = 1; i <= testCount; i++)
			solver.solve(i, in, out);
		out.close();
	}
}

class TaskE {
	public void solve(int testNumber, InputReader in, OutputWriter out) {
        BigInteger ans = F(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
        if((ans+"").length()>10) out.write("...");
        out.writeln(ans.remainder(BigInteger.valueOf(10000000000L)));
	}

    static public BigInteger F(int x1, int y1, int x2, int y2){
        return F(x2,y2).subtract(F(x1-1,y2)).subtract(F(x2,y1-1)).add(F(x1-1,y1-1));
    }

    static public BigInteger F(int n, int m){
        BigInteger k = BigInteger.valueOf(Math.min(n, m));
        if(k.signum()<=0) return BigInteger.ZERO;

        BigInteger res = (BigInteger.ONE.add(k.pow(2))).multiply(k.pow(2)).shiftRight(1);

        if(n>m){
            res = res.add(f1(m+1,n,m));
        }else
        if(m>n){
            res = res.add(f2(n+1,m,n));
        }

        return res;
    }

    static BigInteger f1(long a, long b, long m){
        return f1(b,m).subtract(f1(a-1,m));
    }
    static BigInteger f1(long n, long m){
        BigInteger M = BigInteger.valueOf(m);
        BigInteger res = M.multiply(sumsqr(n)).subtract(M.pow(2).subtract(M).divide(_2).multiply(BigInteger.valueOf(n)));
        return res;
    }

    static BigInteger f2(long a, long b, long n){
        return f2(b,n).subtract(f2(a-1,n));
    }
    static BigInteger f2(long n, long m){
        BigInteger M = BigInteger.valueOf(m);
        BigInteger res = M.multiply(sumsqr(n-1)).add(M.pow(2).add(M).divide(_2).multiply(BigInteger.valueOf(n)));
        return res;
    }

    static BigInteger sumsqr(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.pow(3).multiply(_2).add(N.pow(2).multiply(_3)).add(N).divide(_6);
    }
    static BigInteger _2 = new BigInteger("2");
    static BigInteger _3 = new BigInteger("3");
    static BigInteger _6 = new BigInteger("6");
}

class InputReader{
    private InputStream in;
    private byte buffer[] = new byte[1<<11];
    private int cur;
    private int end;

    public InputReader(InputStream stream){
        in = stream;
    }

    public int read(){
        if(end<0) throw new InputMismatchException();
        if(cur>=end){
            cur = 0;
            try{
                end = in.read(buffer);
            }catch(IOException e){
                throw new InputMismatchException();
            }
            if(end<=0) return -1;
        }
        return buffer[cur++];
    }

    public boolean isSpace(int c){
        return c==' ' || c=='\n' || c=='\r' || c=='\t' || c==-1;
    }

    public String next(){
        StringBuilder s = new StringBuilder();
        int c = read();
        while(isSpace(c)) c = read();
        do{
            s.append((char)c);
            c = read();
        }while(!isSpace(c));
        return s.toString();
    }

    public int nextInt(){
        int c = read(), res = 0, sign = 1;
        while(isSpace(c)) c = read();
        if(c=='-'){ sign = -1; c = read(); }
        do{
            if(c>'9' || c<'0') throw new InputMismatchException();
            res = res*10 + (c-'0');
            c = read();
        }while(!isSpace(c));
        return res*sign;
    }

    }

class OutputWriter{
    private PrintWriter out;

    public OutputWriter(Writer out){
        this.out = new PrintWriter(out);
    }

    public OutputWriter(OutputStream out){
        this.out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));
    }

    public void close(){
        out.close();
    }

    public void write(Object ... o){
        for(Object x : o) out.print(x);
    }

    public void writeln(Object ... o){
        write(o);
        out.println();
    }
}