#include <bits/stdc++.h>
using namespace std;
int Read() {
  char c;
  while (c = getchar(), (c != '-') && (c < '0' || c > '9'))
    ;
  bool neg = (c == '-');
  int ret = (neg ? 0 : c - 48);
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + c - 48;
  return neg ? -ret : ret;
}
const unsigned long long MOD = 1e10;
long double RF(long double x) { return (x + 1) * (2 * x + 1) * x / 6; }
unsigned long long RI(unsigned long long x) {
  unsigned long long ret = x & 1 ? (x + 1) * (2 * x + 1) / 2 % MOD * x % MOD
                                 : x * (2 * x + 1) / 2 % MOD * (x + 1) % MOD;
  while (ret % 3) ret += MOD;
  return (ret / 3) % MOD;
}
long double FF(long double x, long double y) {
  long double s = min(x, y), ret = (s * s + 1) * s * s / 2;
  if (x < y) ret += x * (RF(y - 1) - RF(x - 1)) + x * (x + 1) / 2 * (y - x);
  if (x > y) ret += y * (RF(x) - RF(y)) - y * (y - 1) / 2 * (x - y);
  return ret;
}
unsigned long long FI(unsigned long long x, unsigned long long y) {
  unsigned long long s = min(x, y), ret;
  ret = s & 1 ? ((s * s + 1) / 2) % MOD * s % MOD * s % MOD
              : (s * s + 1) % MOD * s % MOD * (s / 2) % MOD;
  if (x < y) {
    (ret += (RI(y - 1) + MOD - RI(x - 1)) % MOD * x % MOD) %= MOD;
    (ret += (x * (x + 1) / 2) % MOD * (y - x) % MOD) %= MOD;
  }
  if (x > y) {
    (ret += (RI(x) + MOD - RI(y)) % MOD * y % MOD) %= MOD;
    (ret += MOD - (y * (y - 1) / 2) % MOD * (x - y) % MOD) %= MOD;
  }
  return ret;
}
int main() {
  int T = Read();
  for (int ca = 1; ca <= T; ca++) {
    int x1 = Read() - 1, y1 = Read() - 1, x2 = Read(), y2 = Read();
    long double db = FF(x2, y2) - FF(x1, y2) - FF(x2, y1) + FF(x1, y1);
    unsigned long long di =
        2 * MOD + FI(x2, y2) - FI(x1, y2) - FI(x2, y1) + FI(x1, y1);
    if (db < MOD)
      printf("%I64u\n", di % MOD);
    else
      printf("...%010I64u\n", di % MOD);
  }
  return 0;
}
