#include <bits/stdc++.h>
using namespace std;
long long fpm(long long b, long long e, long long m) {
  long long 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]; }
};
long long mod = 10000000000ll, spltdiv = 100000;
long long mulmod(long long x, long long y) {
  x %= mod, y %= mod;
  long long xa = x / spltdiv, xb = x % spltdiv;
  return (xa * y % mod * spltdiv + xb * y) % mod;
}
pair<long double, long long> operator+(pair<long double, long long> x,
                                       pair<long double, long long> y) {
  return make_pair(x.first + y.first, (x.second + y.second) % mod);
}
pair<long double, long long> operator-(pair<long double, long long> x,
                                       pair<long double, long long> y) {
  return make_pair(x.first - y.first, (x.second - y.second + mod) % mod);
}
pair<long double, long long> operator*(pair<long double, long long> x,
                                       pair<long double, long long> y) {
  return make_pair(x.first * y.first, mulmod(x.second, y.second));
}
pair<long double, long long> mk(long long x) { return make_pair(x, x % mod); }
pair<long double, long long> ssum(long long x) {
  long long a = x, b = x + 1;
  if (a % 2 == 0)
    a /= 2;
  else
    b /= 2;
  return mk(a) * mk(b);
}
pair<long double, long long> csum(long long x) {
  long long 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);
}
pair<long double, long long> calc(long long x, long long y) {
  if (!x || !y) return make_pair(0, 0);
  pair<long double, long long> 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() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  for (; t--;) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2, --x1, --y1;
    pair<long double, long long> ans =
        calc(x2, y2) + calc(x1, y1) - calc(x2, y1) - calc(x1, y2);
    if (ans.first >= 1e10)
      cout << "..." << setw(10) << setfill('0') << ans.second << endl;
    else
      cout << ans.second << endl;
  }
  return 0;
}
