#include <bits/stdc++.h>
using namespace std;
long long p, ans1, ans2;
long long mul(long long a, long long b) {
  a %= p;
  b %= p;
  if (b < 0) b += p;
  long long ans = 0;
  for (; b; b >>= 16, a = (a << 16) % p) ans = (ans + a * (b & 65535)) % p;
  return ans;
}
long long sum1(long long n1) {
  long long n2 = n1 + 1;
  if (n1 & 1)
    n2 /= 2;
  else
    n1 /= 2;
  return mul(n1, n2);
}
long long sum2(long long n1) {
  long long n2 = n1 + 1, n3 = n1 + n2;
  if ((~n1) & 1)
    n1 /= 2;
  else if ((~n2) & 1)
    n2 /= 2;
  else
    n3 /= 2;
  if (n1 % 3 == 0)
    n1 /= 3;
  else if (n2 % 3 == 0)
    n2 /= 3;
  else
    n3 /= 3;
  return mul(mul(n1, n2), n3);
}
long long cal(long long n1, long long n2) {
  if (n1 == n2) return sum1(n1 * n1);
  if (n1 < n2)
    return sum1(n1 * n1) + mul(n1, sum2(n2 - 1) - sum2(n1 - 1)) +
           mul(n2 - n1, sum1(n1));
  return sum1(n2 * n2) + mul(n2, sum2(n1) - sum2(n2)) -
         mul(n1 - n2, sum1(n2 - 1));
}
int main() {
  int n, X1, X2, Y1, Y2;
  for (scanf("%d", &n); n; n--) {
    scanf("%d%d%d%d", &X1, &Y1, &X2, &Y2);
    p = 10000000000LL;
    ans1 = (cal(X2, Y2) + cal(X1 - 1, Y1 - 1) - cal(X2, Y1 - 1) -
            cal(X1 - 1, Y2)) %
           p;
    ans1 < 0 ? ans1 += p : 0;
    p = 10000000001LL;
    ans2 = (cal(X2, Y2) + cal(X1 - 1, Y1 - 1) - cal(X2, Y1 - 1) -
            cal(X1 - 1, Y2)) %
           p;
    ans2 < 0 ? ans2 += p : 0;
    if (ans1 == ans2)
      printf("%I64d\n", ans1);
    else
      printf("...%010I64d\n", ans1);
  }
  return 0;
}
