#include <bits/stdc++.h>
const unsigned long long MOD = 10000000000ULL;
struct num {
  long double r;
  unsigned long long a;
  inline num() {}
  inline num(int x) : r(x), a(x) {}
  inline num(long double rr, unsigned long long aa) : r(rr), a(aa) {}
  inline void output() {
    if (r < MOD)
      printf("%I64u\n", a);
    else
      printf("...%010I64u\n", a);
  }
};
inline num operator+(const num x, const num y) {
  return num(x.r + y.r, (x.a + y.a) % MOD);
}
inline num operator-(const num x, const num y) {
  return num(x.r - y.r, (x.a + MOD - y.a) % MOD);
}
inline num operator*(const num x, const num y) {
  return num(x.r * y.r, x.a * y.a % MOD);
}
inline bool operator<(const num x, const num y) { return x.r < y.r; }
inline bool operator>(const num x, const num y) { return x.r > y.r; }
inline num calc_sqr(int x) {
  if (x & 1)
    return (num((x + 1) / 2) * (x - 1) + 1) * x * x;
  else
    return (num(x) * x + 1) * (x / 2) * x;
}
inline num calc_ss(int x) {
  if (x % 6 == 0)
    return num(2 * x + 1) * (x + 1) * (x / 6);
  else if (x % 6 == 1)
    return num(x) * ((x + 1) / 2) * ((2 * x + 1) / 3);
  else if (x % 6 == 2)
    return num(2 * x + 1) * (x / 2) * ((x + 1) / 3);
  else if (x % 6 == 3)
    return num(2 * x + 1) * (x / 3) * ((x + 1) / 2);
  else if (x % 6 == 4)
    return num(x + 1) * (x / 2) * ((2 * x + 1) / 3);
  else
    return num(2 * x + 1) * num(x) * ((x + 1) / 6);
}
inline num calc_dd(int x) {
  if (x & 1)
    return num(x) * ((x + 1) / 2);
  else
    return num(x + 1) * (x / 2);
}
inline num calc(int x, int y) {
  num ans = calc_sqr(std::min(x, y));
  if (x > y)
    ans = ans + (calc_ss(x) - calc_ss(y)) * y - calc_dd(y - 1) * (x - y);
  else if (x < y)
    ans = ans + (calc_ss(y - 1) - calc_ss(x - 1)) * x + calc_dd(x) * (y - x);
  return ans;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    (calc(x2, y2) - calc(x1 - 1, y2) - calc(x2, y1 - 1) + calc(x1 - 1, y1 - 1))
        .output();
  }
  return 0;
}
