#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 2e10;
const long long mod2 = 1e10 + 9;
const long long mod3 = 1e10;
const long long val = 1e16;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
long long mod, T;
inline long long mul(long long x, long long y) {
  if (y < 0) y += mod;
  long long res = 0;
  while (y) {
    if (y & 1) res += x;
    x <<= 1;
    if (x >= val) x %= mod;
    y >>= 1;
  }
  return res % mod;
}
inline long long calc(long long x, long long y) {
  if (!x || !y) return 0;
  long long res = 0;
  if (x == y) {
    long long t = mul(x, x);
    if (t & 1)
      res = mul(t, (t + 1) >> 1);
    else
      res = mul(t >> 1, t + 1);
    return res;
  } else if (x < y) {
    long long t = mul(x, x);
    if (t & 1)
      res = mul(t, (t + 1) >> 1);
    else
      res = mul(t >> 1, t + 1);
    t = mul(x + 3, y - x);
    t -= mul(x + y + 1, (y - x) << 1);
    if (y % 3 == 0)
      t += mul(y / 3, mul(y + 1, y << 1 | 1));
    else if (y % 3 == 1)
      t += mul(y, mul(y + 1, (y << 1 | 1) / 3));
    else
      t += mul(y, mul((y + 1) / 3, y << 1 | 1));
    if (x % 3 == 0)
      t -= mul(x / 3, mul(x + 1, x << 1 | 1));
    else if (x % 3 == 1)
      t -= mul(x, mul(x + 1, (x << 1 | 1) / 3));
    else
      t -= mul(x, mul((x + 1) / 3, x << 1 | 1));
    t = t % mod + mod;
    if (!(t & 1))
      res = (res + mul(x, t >> 1)) % mod;
    else if (mod & 1)
      res = (res + mul(x, (t + mod) >> 1)) % mod;
    else
      res = (res + mul(x >> 1, t)) % mod;
    return res;
  } else {
    swap(x, y);
    long long t = mul(x, x);
    if (t & 1)
      res = mul(t, (t + 1) >> 1);
    else
      res = mul(t >> 1, t + 1);
    t = mod - mul(y - x, x - 1);
    if (y % 3 == 0)
      t += mul(y / 3, mul(y + 1, y << 1 | 1));
    else if (y % 3 == 1)
      t += mul(y, mul(y + 1, (y << 1 | 1) / 3));
    else
      t += mul(y, mul((y + 1) / 3, y << 1 | 1));
    if (x % 3 == 0)
      t -= mul(x / 3, mul(x + 1, x << 1 | 1));
    else if (x % 3 == 1)
      t -= mul(x, mul(x + 1, (x << 1 | 1) / 3));
    else
      t -= mul(x, mul((x + 1) / 3, x << 1 | 1));
    t = t % mod + mod;
    if (!(t & 1))
      res = (res + mul(x, t >> 1)) % mod;
    else if (mod & 1)
      res = (res + mul(x, (t + mod) >> 1)) % mod;
    else
      res = (res + mul(x >> 1, t)) % mod;
    return res;
  }
}
inline long long solve(long long x1, long long y1, long long x2, long long y2) {
  return ((calc(x1 - 1, y1 - 1) + calc(x2, y2) - calc(x1 - 1, y2) -
           calc(x2, y1 - 1)) %
              mod +
          mod) %
         mod;
}
signed main() {
  T = read();
  long long x1, x2, y1, y2;
  while (T--) {
    x1 = read(), y1 = read();
    x2 = read(), y2 = read();
    mod = mod1;
    long long res1 = solve(x1, y1, x2, y2) % mod3;
    mod = mod2;
    long long res2 = solve(x1, y1, x2, y2);
    if (res1 ^ res2)
      printf("...%.10lld\n", res1);
    else
      printf("%lld\n", res1);
  }
  return 0;
}
