#include <bits/stdc++.h>
using namespace std;
struct bignum {
  long long dig[10];
  int len;
  long long &operator[](int k) { return dig[k]; }
  bignum() {}
  bignum(long long x) {
    len = 0;
    do {
      dig[len] = x % 100000000;
      x /= 100000000;
      len++;
    } while (x);
  }
  void print() {
    long long val = 0;
    if (len == 1) {
      val = dig[0];
      printf("%I64d", val);
    } else if (len == 2 && dig[1] * 100000000 + dig[0] < 10000000000LL) {
      val = dig[1] * 100000000 + dig[0];
      printf("%I64d", val);
    } else {
      val = (dig[1] * 100000000 + dig[0]) % 10000000000LL;
      printf("...%010I64d", val);
    }
  }
};
int cmp(bignum a, bignum b) {
  if (a.len < b.len) return -1;
  if (a.len > b.len) return 1;
  for (int i = a.len - 1; i >= 0; i--) {
    if (a[i] < b[i]) return -1;
    if (a[i] > b[i]) return 1;
  }
  return 0;
}
bignum add(bignum a, bignum b) {
  bignum c;
  int len = max(a.len, b.len);
  long long x = 0;
  for (int i = 0; i < len; i++) {
    if (i < a.len) x += a[i];
    if (i < b.len) x += b[i];
    c[i] = x % 100000000;
    x /= 100000000;
  }
  if (x) c[len++] = x;
  c.len = len;
  return c;
}
bignum sub(bignum a, bignum b) {
  bignum c;
  int len = a.len;
  long long x = 0;
  for (int i = 0; i < len; i++) {
    if (i < a.len) x += a[i];
    if (i < b.len) x -= b[i];
    if (x < 0) {
      c[i] = 100000000 + x;
      x = -1;
    } else {
      c[i] = x;
      x = 0;
    }
  }
  while (len > 1 && c[len - 1] == 0) len--;
  c.len = len;
  return c;
}
bignum multi(bignum a, bignum b) {
  bignum c;
  int len = a.len + b.len - 1;
  for (int i = 0; i < len; i++) c[i] = 0;
  for (int i = 0; i < a.len; i++)
    for (int j = 0; j < b.len; j++) {
      c[i + j] += a[i] * b[j];
    }
  for (int i = 0; i < len - 1; i++) {
    c[i + 1] += c[i] / 100000000;
    c[i] %= 100000000;
  }
  while (c[len - 1] >= 100000000) {
    c[len] = c[len - 1] / 100000000;
    c[len - 1] %= 100000000;
    len++;
  }
  while (len > 1 && c[len - 1] == 0) len--;
  c.len = len;
  return c;
}
bignum div(bignum a, long long m) {
  bignum c;
  long long x = 0;
  int len = a.len;
  for (int i = len - 1; i >= 0; i--) {
    x = x * 100000000 + a[i];
    c[i] = x / m;
    x %= m;
  }
  while (len > 1 && c[len - 1] == 0) len--;
  c.len = len;
  return c;
}
bignum sum(long long x) {
  bignum ans;
  if (x % 2 == 0) {
    ans = x / 2;
    ans = multi(ans, x + 1);
  } else {
    ans = x;
    ans = multi(ans, (x + 1) / 2);
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bignum square_sum(long long x) {
  bignum ans;
  long long d = 6;
  ans = x / gcd(x, d);
  d /= gcd(x, d);
  ans = multi(ans, (x + 1) / gcd(x + 1, d));
  d /= gcd(d, x + 1);
  ans = multi(ans, (2 * x + 1) / d);
  return ans;
}
bignum calc(long long X, long long Y) {
  bignum ans;
  if (X < Y) {
    ans = sum(X * X);
    ans = add(multi(sub(square_sum(Y), square_sum(X)), X), ans);
    ans = sub(ans, multi(sum(X - 1), Y - X));
  } else {
    ans = sum(Y * Y);
    ans = add(ans, multi(sub(square_sum(X - 1), square_sum(Y - 1)), Y));
    ans = add(ans, multi(sum(Y), X - Y));
  }
  return ans;
}
int main() {
  bignum ans, temp;
  int T, x1, y1, x2, y2;
  for (scanf("%d", &T); T--;) {
    scanf("%d%d%d%d", &y1, &x1, &y2, &x2);
    x1--, y1--;
    ans = 0;
    ans = sub(calc(x2, y2), calc(x1, y2));
    ans = add(ans, calc(x1, y1));
    ans = sub(ans, calc(x2, y1));
    ans.print();
    puts("");
  }
  return 0;
}
