#include <bits/stdc++.h>
using namespace std;
const long long md = (long long)100000 * 100000;
long long mul(long long x, long long y) {
  x %= md;
  y %= md;
  long long z = (long double)x * y / md;
  return ((x * y - z * md) % md + md) % md;
}
pair<long long, long double> operator+(const pair<long long, long double> &x,
                                       const pair<long long, long double> &y) {
  return make_pair((x.first + y.first) % md, x.second + y.second);
}
pair<long long, long double> operator-(const pair<long long, long double> &x,
                                       const pair<long long, long double> &y) {
  return make_pair((x.first + md - y.first) % md, x.second - y.second);
}
pair<long long, long double> operator+(const pair<long long, long double> &x,
                                       long long y) {
  return make_pair((x.first + y) % md, x.second + y);
}
pair<long long, long double> operator*(const pair<long long, long double> &x,
                                       long long y) {
  return make_pair(mul(x.first, y), x.second * y);
}
pair<long long, long double> c1(long long x) {
  long long y = x, z = x + 1;
  if (y % 2 == 0)
    y /= 2;
  else
    z /= 2;
  return make_pair(mul(y, z), (long double)y * z);
}
pair<long long, long double> c2(long long x) {
  long long y = x, z = x + 1, w = 2 * x + 1;
  if (y % 2 == 0)
    y /= 2;
  else
    z /= 2;
  if (y % 3 == 0)
    y /= 3;
  else if (z % 3 == 0)
    z /= 3;
  else
    w /= 3;
  return make_pair(mul(y, mul(z, w)), (long double)y * z * w);
}
pair<long long, long double> ask(int x, int y) {
  if (!x || !y) return make_pair(0, 0);
  int z = min(x, y);
  pair<long long, long double> w = c1((long long)z * z);
  if (x > y)
    w = w + (c2(x) - c2(y)) * y - c1(y - 1) * (x - y);
  else
    w = w + ((c2(y - 1) + y) - (c2(x - 1) + x)) * x + c1(x - 1) * (y - x);
  return w;
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 1; i <= t; ++i) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    pair<long long, long double> ans =
        ask(x2, y2) - ask(x1 - 1, y2) - ask(x2, y1 - 1) + ask(x1 - 1, y1 - 1);
    if (ans.second > md - 1)
      printf("...%010I64d\n", ans.first);
    else
      printf("%I64d\n", ans.first);
  }
  return 0;
}
