249_E. Endless Matrix_33422
A Russian space traveller Alisa Selezneva, like any other schoolgirl of the late 21 century, is interested in science. She has recently visited the MIT (Moscow Institute of Time), where its chairman and the co-inventor of the time machine academician Petrov told her about the construction of a time machine.

During the demonstration of the time machine performance Alisa noticed that the machine does not have high speed and the girl got interested in the reason for such disadvantage. As it turns out on closer examination, one of the problems that should be solved for the time machine isn't solved by an optimal algorithm. If you find a way to solve this problem optimally, the time machine will run faster and use less energy.

A task that none of the staff can solve optimally is as follows. There exists a matrix a, which is filled by the following rule:

The cells are consecutive positive integers, starting with one. Besides, ai, j < at, k (i, j, t, k ≥ 1), if:

  1. max(i, j) < max(t, k); 
  2. max(i, j) = max(t, k) and j < k; 
  3. max(i, j) = max(t, k), j = k and i > t. 



So, after the first 36 numbers are inserted, matrix a will look as follows:

<image>

To solve the problem, you should learn to find rather quickly for the given values of x1, y1, x2 and y2 (x1 ≤ x2, y1 ≤ y2) the meaning of expression:

<image>

As the meaning of this expression can be large enough, it is sufficient to know only the last 10 digits of the sought value.

So, no one in MTI can solve the given task. Alice was brave enough to use the time machine and travel the past to help you.

Your task is to write a program that uses the given values x1, y1, x2 and y2 finds the last 10 digits of the given expression.

Input

The first input line contains a single integer t (1 ≤ t ≤ 105) — the number of test sets for which you should solve the problem. 

Each of the next t lines contains the description of a test — four positive integers x1, y1, x2 and y2 (1 ≤ x1 ≤ x2 ≤ 109, 1 ≤ y1 ≤ y2 ≤ 109), separated by spaces.

Output

For each query print the meaning of the expression if it contains at most 10 characters. Otherwise, print three characters "." (without the quotes), and then ten last digits of the time expression. Print the answer to each query on a single line. Follow the format, given in the sample as closely as possible.

Examples

Input

5
1 1 1 1
2 2 3 3
2 3 5 6
100 87 288 2002
4 2 5 4


Output

1
24
300
...5679392764
111
#include <bits/stdc++.h>
using namespace std;
long long tmp[10];
struct Bigint {
  const static int maxn = 10;
  const static int Base = (int)1e5;
  int a[maxn];
  int n;
  Bigint(long long x = 0) {
    n = 0;
    for (; x; x /= Base) a[n++] = x % Base;
  }
  void operator+=(const Bigint &b) {
    for (; n < b.n; a[n++] = 0)
      ;
    for (int i = 0; i < b.n; i++) a[i] += b.a[i];
    for (int i = 0; i < n; i++)
      if (a[i] >= Base) {
        a[i] -= Base;
        if (i == n - 1)
          a[n++] = 1;
        else
          a[i + 1]++;
      }
  }
  void operator-=(const Bigint &b) {
    assert(n >= b.n);
    for (int i = 0; i < b.n; i++) a[i] -= b.a[i];
    for (int i = 0; i < n; i++)
      if (a[i] < 0) {
        a[i] += Base;
        a[i + 1]--;
      }
    for (; n && !a[n - 1]; --n)
      ;
  }
  void operator*=(const Bigint &b) {
    if (!n || !b.n) {
      n = 0;
      return;
    }
    memset(tmp, 0, sizeof(tmp[0]) * (n + b.n + 1));
    for (int i = 0; i < n; i++)
      for (int j = 0; j < b.n; j++) tmp[i + j] += (long long)a[i] * b.a[j];
    n = n + b.n - 1;
    long long left = 0;
    for (int i = 0; i < n || left; i++) {
      if (i == n) n++;
      left += tmp[i];
      a[i] = left % Base;
      left /= Base;
    }
  }
  void print() const {
    if (n > 2)
      printf("...%05d%05d\n", a[1], a[0]);
    else {
      if (n == 2)
        printf("%d%05d\n", a[1], a[0]);
      else
        printf("%d\n", n ? a[0] : 0);
    }
  }
};
Bigint countFunc(int R, int l, int r) {
  int tmp[3] = {R, R + 1, 2 * R + 1};
  for (int it = 2; it <= 3; it++)
    for (int i = 0; i < 3; i++)
      if (!(tmp[i] % it)) {
        tmp[i] /= it;
        break;
      }
  Bigint r1 = tmp[0];
  r1 *= tmp[1];
  r1 *= tmp[2];
  r1 *= r - l;
  Bigint r2 = (long long)R + 1;
  long long coef = ((long long)r * (r + 1) - (long long)l * (l + 1)) / 2;
  r2 *= abs(coef);
  if (coef >= 0)
    r1 += r2;
  else
    r1 -= r2;
  return r1;
}
Bigint countRect(long long x, long long y) {
  long long tmp = min(x, y) * min(x, y);
  Bigint res = 1;
  for (int it = 0; it < 2; it++, tmp++) res *= ((tmp & 1) ? tmp : tmp / 2);
  if (x > y) {
    res += countFunc(x - 1, 0, y);
    res -= countFunc(y - 1, 0, y);
  }
  if (x < y) {
    res += countFunc(y, -x, 0);
    res -= countFunc(x, -x, 0);
  }
  return res;
}
void solve() {
  int x1, x2, y1, y2;
  scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
  --x1, --y1;
  swap(x1, y1), swap(x2, y2);
  Bigint res = countRect(x2, y2);
  res += countRect(x1, y1);
  res -= countRect(x1, y2);
  res -= countRect(x2, y1);
  res.print();
}
int main() {
  int t;
  while (scanf("%d", &t) >= 1) {
    for (; t; t--) solve();
  }
  return 0;
}
