#include <bits/stdc++.h>
using namespace std;
const long long P = 1000000000000LL;
long long co[10][10];
long long mul(long long a, long long b) {
  a %= P, b %= P;
  if (a <= (long long)(1e8) && b <= (long long)(1e8)) return a * b % P;
  return (a * b - (long long)(a / (long double)P * b + 1e-3) * P + P) % P;
}
long long sqr(long long x) { return mul(x, x); }
long long dcr(long long x) { return mul(x, mul(x, x)); }
long long mpow(long long x, int n) {
  long long ans = 1;
  while (n--) ans = mul(ans, x);
  return ans;
}
long long calc_S(long long n, long long m) {
  if (n == 0) return 0;
  if (m == 1) {
    if (n % 2 == 0) return mul(n / 2, n + 1);
    return mul(n, (n + 1) / 2);
  }
  if (m == 2) {
    if (n % 3 == 0)
      return mul(mul(n / 3, n + 1), 2 * n + 1) / 2;
    else if ((n + 1) % 3 == 0)
      return mul(mul((n + 1) / 3, n), 2 * n + 1) / 2;
    return mul(mul(n, n + 1), (2 * n + 1) / 3) / 2;
  }
  if (n % 2 == 0) return sqr(mul(n / 2, n + 1));
  return sqr(mul(n, (n + 1) / 2));
}
long double calc_Sd(long long n, long long m) {
  if (n == 0) return 0;
  if (m == 1) return (long double)n * (n + 1) / 2;
  if (m == 2) return (long double)n * (n + 1) * (2 * n + 1) / 6;
  if (m == 3) return (long double)n * n * (n + 1) * (n + 1) / 4;
}
long long calc(long long n, long long m) {
  if (n == 0 || m == 0) return 0;
  long long t = min(n, m);
  long long ans = 0;
  ans += 2 * dcr(t) + P - mul(2 * m + 1, sqr(t)) + t +
         mul(mul(m, 1 - m + P), n - t);
  ans %= P;
  ans += 4 * calc_S(t - 1, 3) + 2 * P - 2 * mul(n + m, calc_S(t - 1, 2)) +
         2 * mul(m, calc_S(n, 2));
  ans %= P;
  ans += 2 * calc_S(t - 1, 1) + 2 * mul(n, calc_S(m - 1, 2)) +
         mul(mul(n, n + 1), m - t);
  ans %= P;
  return ans;
}
long double calcd(long long n, long long m) {
  if (n == 0 || m == 0) return 0;
  long long t = min(n, m);
  long double ans = 0;
  ans += 2.0 * t * t * t - (2.0 * m + 1) * t * t + (long double)t +
         (long double)m * (1 - m) * (n - t);
  ans += 4.0 * calc_Sd(t - 1, 3) - 2.0 * (n + m) * calc_Sd(t - 1, 2) +
         2.0 * m * calc_Sd(n, 2);
  ans += 2.0 * calc_Sd(t - 1, 1) + 2.0 * n * calc_Sd(m - 1, 2) +
         (long double)n * (n + 1) * (m - t);
  return ans;
}
long double check(long long l1, long long l2, long long r1, long long r2) {
  long double ans = calcd(r1, r2) - calcd(l1 - 1, r2) - calcd(r1, l2 - 1) +
                    calcd(l1 - 1, l2 - 1);
  ans /= 2;
  return ans;
}
int main() {
  int T;
  cin >> T;
  long long l1, l2, r1, r2;
  co[0][0] = 1;
  for (int i = 1; i < 10; i++) {
    co[i][0] = 1;
    for (int j = 1; j <= i; j++)
      co[i][j] = (co[i - 1][j] + co[i - 1][j - 1]) % P;
  }
  while (~scanf("%I64d%I64d%I64d%I64d", &l1, &l2, &r1, &r2)) {
    long long ans = calc(r1, r2) + P - calc(l1 - 1, r2) + P - calc(r1, l2 - 1) +
                    calc(l1 - 1, l2 - 1);
    ans %= P;
    ans /= 2;
    if ((ans / (P / 100)) == 0 && check(l1, l2, r1, r2) < 1e11)
      printf("%I64d\n", ans);
    else
      printf("...%010I64d\n", ans % (P / 100));
  }
  return 0;
}
