/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
//		cout << ans << endl;
		if(x1 > 0 && yy > 0) ans += count(x1 - 1, yy - 1);
//		cout << ans << endl;
		ans += mod;
		if(x1 > 0) ans -= count (x1 - 1, y2);
//		cout << ans << endl;
		ans += mod;
		if(yy > 0) ans -= count (x2, yy - 1);
//		cout << ans << endl;
		ans %= mod;
		if(ans > mod / 100){
			ull ans1 = ans;
			ans = ans % (mod / 100);
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			printf("...");
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		}
		else printf("%I64u\n", ans);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <long double> vd;

const long double pi = acos(0.0) * 2.0;
const long double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(long double a, long double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline long double dsumsqr(long double n){
	long double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline long double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	long double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		long double x1 = dsumsqr(min1(x, y));
		long double x2 = dsumsqr(max1(x, y));
		long double a = x2 - x1;
		long double c = max1(x, y) - min1(x, y);
		long double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		long double x1 = dsumsqr(min1(x, y) + 1);
		long double x2 = dsumsqr(max1(x, y) + 1);
		long double a = x2 - x1;
		long double c = max1(x, y) - min1(x, y);
		long double xiang = min1(x, y);
		ans += a * (xiang + 1);
		long double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		long double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
//		cout << ans << endl;
		if(x1 > 0 && yy > 0) ans += count(x1 - 1, yy - 1);
//		cout << ans << endl;
		ans += mod;
		if(x1 > 0) ans -= count (x1 - 1, y2);
//		cout << ans << endl;
		ans += mod;
		if(yy > 0) ans -= count (x2, yy - 1);
//		cout << ans << endl;
		ans %= mod;
		if(ans > mod / 100){
			ans = ans % (mod / 100);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			printf("...");
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		}
		else printf("%I64u\n", ans);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mmod = 10000000000ull;
inline ull multi(ull x, ull y, ull mod){
	ull ans = 0;
	ull x1 = x % 1000000, x2 = x / 1000000;
	ans += x1 * y;
	ans %= mod;
	ans += (((x2 * y) % mod) * 1000000) % mod;
	ans %= mod;
	return ans;
}

inline ull sumsqr(ull n, ull mod){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod), mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count1(ull x, ull y, ull mod){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod, mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod, mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod, mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod, mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y), mod);
		ull x2 = sumsqr(max1(x, y), mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1, mod);
		ull x2 = sumsqr(max1(x, y) + 1, mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount1(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if(i == 0) rem = x1;
//		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count1(x2, y2, mmod);
		double dans = dcount1(x2, y2);
		ull mmod1 = mmod + 1;
		ull ansr = count1(x2, y2, mmod1);
		if(x1 > 0 && yy > 0){
			ans += count1(x1 - 1, yy - 1, mmod);
			ansr += count1(x1 - 1, yy - 1, mmod1);
			dans += dcount1(x1 - 1, yy - 1);
		}
		ans += mmod;
		ansr += mmod1;
		if(x1 > 0){
			ans -= count1 (x1 - 1, y2, mmod);
			ansr -= count1 (x1 - 1, y2, mmod1);
			dans -= dcount1(x1 - 1, y2);
		}
		ans += mmod;
		ansr += mmod1;
		if(yy > 0){
			ans -= count1 (x2, yy - 1, mmod);
			ansr -= count1 (x2, yy - 1, mmod1);
			dans -= dcount1(x2, yy - 1);
		}
		ans %= mmod;
		ansr %= mmod1;
		if(dans > mmod || ansr != ans){
			printf("...");
			ans = ans % (mmod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mmod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;

inline ull sumsqr(ull n){
	ull ans = (((((n * (n + 1)) / 2ull) % mod)  * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi((x * y + 1) / 2, x * y);
		return multi((x * y + 1), x * y / 2);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi((ans * ans + 1) / 2, ans * ans);
	else ans = multi(ans * ans / 2, ans * ans + 1);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = sumsqr(min1(x, y) + 1);
		double x2 = sumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;

inline ull sumsqr(ull n){
	ull ans = (((((n * (n + 1)) / 2ull) % mod)  * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi((x * y + 1) / 2, x * y);
		return multi((x * y + 1), x * y / 2);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi((ans * ans + 1) / 2, ans * ans);
	else ans = multi(ans * ans / 2, ans * ans + 1);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = sumsqr(min1(x, y) + 1);
		double x2 = sumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod / 100){
			printf("...");
			ans = ans % (mod / 100);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;

inline ull sumsqr(ull n){
	ull ans = (((((n * (n + 1)) / 2ull) % mod)  * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
//		cout << ans << endl;
		if(x1 > 0 && yy > 0) ans += count(x1 - 1, yy - 1);
//		cout << ans << endl;
		ans += mod;
		if(x1 > 0) ans -= count (x1 - 1, y2);
//		cout << ans << endl;
		ans += mod;
		if(yy > 0) ans -= count (x2, yy - 1);
//		cout << ans << endl;
		ans %= mod;
		if(ans > mod / 100){
			ans = ans % (mod / 100);
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			printf("...");
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans);
		}
		else printf("%I64u\n", ans);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;

inline ull sumsqr(ull n){
	ull ans = (((((n * (n + 1)) / 2ull) % mod)  * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1), x * y / 2);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi(ans * ans / 2, ans * ans + 1);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}

inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
//	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
//		if(i == 0) rem = x1;
//		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mmod = 10000000000ull;
inline ull multi(ull x, ull y, ull mod){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}

inline ull sumsqr(ull n, ull mod){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod), mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count1(ull x, ull y, ull mod){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod, mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod, mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod, mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod, mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y), mod);
		ull x2 = sumsqr(max1(x, y), mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1, mod);
		ull x2 = sumsqr(max1(x, y) + 1, mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount1(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if(i == 0) rem = x1;
//		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count1(x2, y2, mmod);
		double dans = dcount1(x2, y2);
		ull mmod1 = mmod * 2 + 138923478;
		ull ansr = count1(x2, y2, mmod1);
		if(x1 > 0 && yy > 0){
			ans += count1(x1 - 1, yy - 1, mmod);
			ansr += count1(x1 - 1, yy - 1, mmod1);
			dans += dcount1(x1 - 1, yy - 1);
		}
		ans += mmod;
		ansr += mmod1;
		if(x1 > 0){
			ans -= count1 (x1 - 1, y2, mmod);
			ansr -= count1 (x1 - 1, y2, mmod1);
			dans -= dcount1(x1 - 1, y2);
		}
		ans += mmod;
		ansr += mmod1;
		if(yy > 0){
			ans -= count1 (x2, yy - 1, mmod);
			ansr -= count1 (x2, yy - 1, mmod1);
			dans -= dcount1(x2, yy - 1);
		}
		ans %= mmod;
		ansr %= mmod1;
		if(dans > mmod || ansr != ans){
			printf("...");
			ans = ans % (mmod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mmod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y, ull mod){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}

inline ull sumsqr(ull n, ull mod){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod), mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y, ull mod){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod, mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod, mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod, mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod, mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y), mod);
		ull x2 = sumsqr(max1(x, y), mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1, mod);
		ull x2 = sumsqr(max1(x, y) + 1, mod);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if(i == 0) rem = x1;
//		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2, mod);
		double dans = dcount(x2, y2);
		ull mod1 = mod * 2 + 138923478;
		ull ansr = count(x2, y2, mod1);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1, mod);
			ansr += count(x1 - 1, yy - 1, mod1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		ansr += mod1;
		if(x1 > 0){
			ans -= count (x1 - 1, y2, mod);
			ansr -= count (x1 - 1, y2, mod1);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		ansr += mod1;
		if(yy > 0){
			ans -= count (x2, yy - 1, mod);
			ansr -= count (x2, yy - 1, mod1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		ansr %= mod;
		if(dans > mod || ansr != ans){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}

inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if(i == 0) rem = x1;
//		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if((n == 100000) && i == 20878 && rem == 999990710) printf("%lf\n", dans);
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <long double> vd;

const long double pi = acos(0.0) * 2.0;
const long double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(long double a, long double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline long double dsumsqr(long double n){
	long double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline long double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return long double(x * y) * long double(x * y + 1) / 2;
	}
	long double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		long double x1 = dsumsqr(min1(x, y));
		long double x2 = dsumsqr(max1(x, y));
		long double a = x2 - x1;
		long double c = max1(x, y) - min1(x, y);
		long double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		long double x1 = dsumsqr(min1(x, y) + 1);
		long double x2 = dsumsqr(max1(x, y) + 1);
		long double a = x2 - x1;
		long double c = max1(x, y) - min1(x, y);
		long double xiang = min1(x, y);
		ans += a * (xiang + 1);
		long double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
	//	if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		long double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;

inline ull sumsqr(ull n){
	ull ans = (((((n * (n + 1)) / 2ull) % mod)  * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi((x * y + 1) / 2, x * y);
		return multi((x * y + 1), x * y / 2);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi((ans * ans + 1) / 2, ans * ans);
	else ans = multi(ans * ans / 2, ans * ans + 1);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if((n == 100) && i == 15)printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
//		cout << ans << endl;
		if(x1 > 0 && yy > 0) ans += count(x1 - 1, yy - 1);
//		cout << ans << endl;
		ans += mod;
		if(x1 > 0) ans -= count (x1 - 1, y2);
//		cout << ans << endl;
		ans += mod;
		if(yy > 0) ans -= count (x2, yy - 1);
//		cout << ans << endl;
		ans %= mod;
		double mina;
		if(x1 > yy) mina = x1 * x1 + yy + 1;
		else mina = (yy + 1) * (yy + 1) - x1;
		double nn = (x2 - x1 + 1) * (y2 - yy + 1);
		mina *= nn;
		if(ans > mod / 100 || mina > mod){
			printf("...");
			ans = ans % (mod / 100);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 10000000000ull;
inline ull multi(ull x, ull y){
	ull ans = 0;
	ull x1 = x % 100000, x2 = x / 100000;
	ans += x1 * y;
	ans += (x2 * y) % (mod / 100000) * 100000;
	ans %= mod;
	return ans;
}
inline ull sumsqr(ull n){
	ull ans = multi((((n * (n + 1)) / 2ull) % mod), ((2ull * n + 1ull) % mod));
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		if(x & 1) return multi(((x * y + 1) / 2) % mod, (x * y) % mod);
		return multi((x * y + 1) % mod, (x * y / 2) % mod);
	}
	ull ans = min1(x, y) + 1;
	if(ans & 1) ans = multi(((ans * ans + 1) / 2) % mod, (ans * ans) % mod);
	else ans = multi((ans * ans / 2) % mod, (ans * ans + 1) % mod);
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += ((((xiang * (xiang + 1)) / 2ull) % mod) * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = ((((xiang * (xiang + 1)) / 2) % mod) * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
inline double dsumsqr(double n){
	double ans = n * (n + 1) * (2 * n + 1) / 6;
	return ans;
}
inline double dcount(ull x, ull y){
	if(x == y){
		x++, y++;
		return double(x * y) * double(x * y + 1) / 2;
	}
	double ans = min1(x, y) + 1;
	ans = (ans * ans) * (ans * ans + 1) / 2;
	if(y < x){
		double x1 = dsumsqr(min1(x, y));
		double x2 = dsumsqr(max1(x, y));
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y) + 1;
		ans += (xiang * (xiang + 1)) / 2 * c;
		ans += a * xiang;
	}else {
		double x1 = dsumsqr(min1(x, y) + 1);
		double x2 = dsumsqr(max1(x, y) + 1);
		double a = x2 - x1;
		double c = max1(x, y) - min1(x, y);
		double xiang = min1(x, y);
		ans += a * (xiang + 1);
		double ans1 = (xiang * (xiang + 1)) / 2 * c;
		ans -= ans1;
	}
	return ans;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	ull rem;
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		if(i == 0) rem = x1;
		if((n == 100000) && i == 20878 && rem == 999990710) printf("%I64u %I64u %I64u %I64u\n", x1, yy, x2, y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
		double dans = dcount(x2, y2);
		if(x1 > 0 && yy > 0){
			ans += count(x1 - 1, yy - 1);
			dans += dcount(x1 - 1, yy - 1);
		}
		ans += mod;
		if(x1 > 0){
			ans -= count (x1 - 1, y2);
			dans -= dcount(x1 - 1, y2);
		}
		ans += mod;
		if(yy > 0){
			ans -= count (x2, yy - 1);
			dans -= dcount(x2, yy - 1);
		}
		ans %= mod;
		if(dans > mod){
			printf("...");
			ans = ans % (mod);
			ull ans1 = ans;
			int i = 0;
			for(; ans > 0; i++) ans /= 10;
			for(int j = i; j < 10; j++) printf("0");
			printf("%I64u\n", ans1);
		} else printf("%I64u\n", ans %mod);
	}

	return 0;
}


/*
 * temp.cpp
 *
 *  Created on: 2012-7-18
 *      Author: BSBandme
 */
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <iomanip>
#include <deque>
#include <utility>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <climits>
#include <cctype>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <double> vd;

const double pi = acos(0.0) * 2.0;
const double eps = 1e-12;

template <class T> inline T abs1(T a) {return a < 0 ? -a : a;}
template <class T> inline T max1(T a, T b) {return a > b ? a : b;}
template <class T> inline T min1(T a, T b) {return a < b ? a : b;}
template <class T> inline T gcd1(T a, T b) {
	if(a < b) swap(a, b);
	if(a % b == 0) return b;
	return gcd1(b, a % b);
}
template <class T> inline T lb(T num) {return num & (-num); }
inline int bitnum(ll nValue){
    nValue = ((0xaaaaaaaaaaaaaaaall & nValue)>>1) + (0x5555555555555555ll & nValue);
    nValue = ((0xccccccccccccccccll & nValue)>>2) + (0x3333333333333333ll & nValue);
    nValue = ((0xf0f0f0f0f0f0f0f0ll & nValue)>>4) + (0x0f0f0f0f0f0f0f0fll & nValue);
    nValue = ((0xff00ff00ff00ff00ll & nValue)>>8) + (0x00ff00ff00ff00ffll & nValue);
    nValue = ((0xffff0000ffff0000ll & nValue)>>16) + (0x0000ffff0000ffffll & nValue);
    nValue = ((0xffffffff00000000ll & nValue)>>32) + (0x00000000ffffffffll & nValue);
	return nValue;
}
inline int jud(double a, double b){
	if(abs1(a - b) < eps) return 0;
	if(a < b) return -1;
	return 1;
}
long long pow(long long n, long long m, long long mod = 0){
	long long ans = 1;
	long long k = n;
	while(m){
		if(m & 1) {
			ans *= k;
			if(mod) ans %= mod;
		}
		k *= k;
		if(mod) k %= mod;
		m >>= 1;
	}
	return ans;
}

ull x1, x2, yy, y2;
const ull mod = 1000000000000ull;

inline ull sumsqr(ull n){
	ull ans = ((((n * (n + 1)) % mod) / 2ull * (2ull * n + 1ull)) % mod);
	if(ans % 3 == 0) return ans / 3;
	if((ans + mod) % 3 == 0) return (ans + mod) / 3;
	return (ans + mod * 2) / 3;
}
inline ull count(ull x, ull y){
	if(x == y){
		x++, y++;
		return ((((x * y) % mod) * (((x * y + 1) % mod))) % mod) / 2;
	}
	ull ans = min1(x, y) + 1;
	ans = ((((ans * ans) % mod) * (((ans * ans + 1) % mod))) % mod) / 2;
	ans %= mod;
	if(y < x){
		ull x1 = sumsqr(min1(x, y));
		ull x2 = sumsqr(max1(x, y));
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y) + 1;
		ans += (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		ans += (a * xiang) % mod;
	}else {
		ull x1 = sumsqr(min1(x, y) + 1);
		ull x2 = sumsqr(max1(x, y) + 1);
		if(x1 > x2) x2 += mod;
		ull a = x2 - x1;
		ull c = max1(x, y) - min1(x, y);
		ull xiang = min1(x, y);
		ans += (a * (xiang + 1)) % mod;
		ull ans1 = (((xiang * (xiang + 1)) % mod) / 2 * c) % mod;
		if(ans < ans1) ans += mod;
		ans -= ans1;
	}
	return ans % mod;
}
int main(){
//	freopen("input.txt","r", stdin);
//	ifstream cin("input.txt");
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%I64u%I64u%I64u%I64u", &x1, &yy, &x2, &y2);
		x1--; yy--; x2--; y2--;
		swap(x1, yy); swap(x2, y2);
		ull ans = count(x2, y2);
//		cout << ans << endl;
		if(x1 > 0 && yy > 0) ans += count(x1 - 1, yy - 1);
//		cout << ans << endl;
		ans += mod;
		if(x1 > 0) ans -= count (x1 - 1, y2);
//		cout << ans << endl;
		ans += mod;
		if(yy > 0) ans -= count (x2, yy - 1);
//		cout << ans << endl;
		ans %= mod;
		if(ans > mod / 100) printf("...%I64u\n", ans % (mod / 100));
		else printf("%I64u\n", ans);
	}

	return 0;
}