import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskE solver = new TaskE();
		int testCount = Integer.parseInt(in.next());
		for (int i = 1; i <= testCount; i++)
			solver.solve(i, in, out);
		out.close();
	}
}

class TaskE {
	public void solve(int testNumber, InputReader in, OutputWriter out) {
        BigInteger ans = F(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
        String s = ans+"";
        if(s.length()>10) out.writeln("...",s.substring(s.length()-10));
        else out.writeln(s);
	}

    static public BigInteger F(int x1, int y1, int x2, int y2){
        return F(x2,y2).subtract(F(x1-1,y2)).subtract(F(x2,y1-1)).add(F(x1-1,y1-1));
    }

    static public BigInteger F(int n, int m){
        BigInteger k = BigInteger.valueOf(Math.min(n, m));
        if(k.signum()<=0) return BigInteger.ZERO;

        BigInteger res = (BigInteger.ONE.add(k.pow(2))).multiply(k.pow(2)).shiftRight(1);

        if(n>m){
            res = res.add(f1(m+1,n,m));
        }else
        if(m>n){
            res = res.add(f2(n+1,m,n));
        }

        return res;
    }

    static BigInteger f1(long a, long b, long m){
        return f1(b,m).subtract(f1(a-1,m));
    }
    static BigInteger f1(long n, long m){
        BigInteger M = BigInteger.valueOf(m);
        BigInteger res = M.multiply(sumsqr(n)).subtract(M.pow(2).subtract(M).divide(_2).multiply(BigInteger.valueOf(n)));
        return res;
    }

    static BigInteger f2(long a, long b, long n){
        return f2(b,n).subtract(f2(a-1,n));
    }
    static BigInteger f2(long n, long m){
        BigInteger M = BigInteger.valueOf(m);
        BigInteger res = M.multiply(sumsqr(n-1)).add(M.pow(2).add(M).divide(_2).multiply(BigInteger.valueOf(n)));
        return res;
    }

    static BigInteger sumsqr(long n){
        BigInteger N = BigInteger.valueOf(n);
        return N.pow(3).multiply(_2).add(N.pow(2).multiply(_3)).add(N).divide(_6);
    }
    static BigInteger _2 = new BigInteger("2");
    static BigInteger _3 = new BigInteger("3");
    static BigInteger _6 = new BigInteger("6");
}

class InputReader{
    private InputStream in;
    private byte buffer[] = new byte[1<<11];
    private int cur;
    private int end;

    public InputReader(InputStream stream){
        in = stream;
    }

    public int read(){
        if(end<0) throw new InputMismatchException();
        if(cur>=end){
            cur = 0;
            try{
                end = in.read(buffer);
            }catch(IOException e){
                throw new InputMismatchException();
            }
            if(end<=0) return -1;
        }
        return buffer[cur++];
    }

    public boolean isSpace(int c){
        return c==' ' || c=='\n' || c=='\r' || c=='\t' || c==-1;
    }

    public String next(){
        StringBuilder s = new StringBuilder();
        int c = read();
        while(isSpace(c)) c = read();
        do{
            s.append((char)c);
            c = read();
        }while(!isSpace(c));
        return s.toString();
    }

    public int nextInt(){
        int c = read(), res = 0, sign = 1;
        while(isSpace(c)) c = read();
        if(c=='-'){ sign = -1; c = read(); }
        do{
            if(c>'9' || c<'0') throw new InputMismatchException();
            res = res*10 + (c-'0');
            c = read();
        }while(!isSpace(c));
        return res*sign;
    }

    }

class OutputWriter{
    private PrintWriter out;

    public OutputWriter(Writer out){
        this.out = new PrintWriter(out);
    }

    public OutputWriter(OutputStream out){
        this.out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));
    }

    public void close(){
        out.close();
    }

    public void write(Object ... o){
        for(Object x : o) out.print(x);
    }

    public void writeln(Object ... o){
        write(o);
        out.println();
    }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 100000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L*912345;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		if(c1 > c2)return 0;
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		if(r1 > r2)return 0;
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L};

		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L*912345;
			long ret = calc(r1, c1, r2, c2);

			if(mod >= 10000000000L){
				out.print("...");
				String rs = Long.toString(ret%10000000000L);
				for(int i = rs.length();i<10;i++){
					out.print("0");
				}
				out.println(rs);
			}else{
				out.println(ret);
			}
//			for(long s : f){
//				mod = s;
//				long rets = calc(r1, c1, r2, c2);
//				if(rets != ret){
//					out.print("...");
//					String rs = Long.toString(ret);
//					for(int i = rs.length();i<10;i++){
//						out.print("0");
//					}
//					out.println(rs);
////					out.printf("...%010d\n", ret);
//					continue outer;
//				}
//			}
//			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
//		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r <= 0)return 0;
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
//		int n = 100000, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(n + " ");
//		for(int i = 0;i < n;i++){
//			sb.append(gen.nextInt(1000)+1 + " ");
//			sb.append(gen.nextInt(1000)+1 + " ");
//			sb.append(1000000000-gen.nextInt(1000) + " ");
//			sb.append(1000000000-gen.nextInt(1000) + " ");
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		if(c1 > c2)return 0;
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		if(r1 > r2)return 0;
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L};
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);

			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets != ret){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L, 9876543210987L};
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L*912345;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		if(c1 > c2)return 0;
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		if(r1 > r2)return 0;
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L};

		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long S = (long)(r2-r1+1)*(c2-c1+1);
//			mod = 10000000000L*912345;
			long ret = calc(r1, c1, r2, c2);

			if(S >= 10000000000L || ret >= 10000000000L){
				out.print("...");
				String rs = Long.toString(ret%10000000000L);
				for(int i = rs.length();i<10;i++){
					out.print("0");
				}
				out.println(rs);
			}else{
				out.println(ret);
			}
//			for(long s : f){
//				mod = s;
//				long rets = calc(r1, c1, r2, c2);
//				if(rets != ret){
//					out.print("...");
//					String rs = Long.toString(ret);
//					for(int i = rs.length();i<10;i++){
//						out.print("0");
//					}
//					out.println(rs);
////					out.printf("...%010d\n", ret);
//					continue outer;
//				}
//			}
//			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
//		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r <= 0)return 0;
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
//		int n = 100000, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(n + " ");
//		for(int i = 0;i < n;i++){
//			sb.append(gen.nextInt(1000)+1 + " ");
//			sb.append(gen.nextInt(1000)+1 + " ");
//			sb.append(1000000000-gen.nextInt(1000) + " ");
//			sb.append(1000000000-gen.nextInt(1000) + " ");
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 100000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%10d\n", ret);
					continue outer;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		if(c1 > c2)return 0;
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		if(r1 > r2)return 0;
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L};
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);

			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets != ret){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
//		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		if(r <= 0)return 0;
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r <= 0)return 0;
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 100000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.print("...");
					break;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.print(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)a+=mod;
		while(b >= mod)a-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 100000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L};
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets != ret){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			mod = 10000000000L;
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		a %= mod;
		if(a<0)a+=mod;
		b %= mod;
		if(b<0)b+=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round152;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class E {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	static long mod = 10000000000L;

	long right(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(c2-1)-c3(c1-2), r2-r1+1)+mul(c2(r2)-c2(r1-1), c2-c1+1))%mod;
	}

	long left(int r1, int c1, int r2, int c2)
	{
		if(r1 > r2)return 0;
		if(c1 > c2)return 0;
		return (mul(c3(r2)-c3(r1-1), c2-c1+1)-mul(c2(c2-1)-c2(c1-2), r2-r1+1)+mod)%mod;
	}

	long diagr(int r1, int c1, int c2)
	{
		return ((c4(c2)-2*c3(c2)+c2(c2))-(c4(c1-1)-2*c3(c1-1)+c2(c1-1))+
				mul(-r1+1, (c3(c2)-2*c2(c2)+c2)-(c3(c1-1)-2*c2(c1-1)+(c1-1)))+
				(q3(c2)-q3(c1-1))-
				mul(c2(r1-1), c2-c1+1)
				+20*mod)%mod;
	}

	long diagl(int c1, int r1, int r2)
	{
		return ((c4(r2)-c4(r1-1))+
				mul(-c1, c3(r2)-c3(r1-1))-
				(q3(r2-2)-q3(r1-3))+
				mul(c2(c1-2), r2-r1+1)
				+20*mod)%mod;
	}

	long calc(int r1, int c1, int r2, int c2)
	{
		if(r2 <= c1){
			return right(r1, c1, r2, c2);
		}else if(r1 >= c2){
			return left(r1, c1, r2, c2);
		}else if(r2 > c1 && r1 <= c1){
			if(r2 <= c2){
				return (diagr(r1, c1, r2)+right(r1,r2+1,r2,c2)+diagl(c1, c1+1, r2))%mod;
			}else{
				return (diagr(r1, c1, c2)+diagl(c1, c1+1, c2)+left(c2+1, c1, r2, c2))%mod;
			}
		}else{
			if(r2 > c2){
				return (diagr(r1, r1, c2)+diagl(c1, r1, c2)+left(c2+1, c1, r2, c2))%mod;
			}else{
				return (diagr(r1, r1, r2)+diagl(c1, r1, r2)+right(r1, r2+1, r2, c2))%mod;
			}
		}
	}

	void solve()
	{
//		long[] f = new long[]{1234567890123L, 9876543210987L, 1010101010101L};
		long[] f = new long[]{1234567890123L, 98765432109876L};
		outer:
		for(int T = ni();T >= 1;T--){
			int r1 = ni(), c1 = ni(), r2 = ni(), c2 = ni();
			mod = 10000000000L;
			long ret = calc(r1, c1, r2, c2);
			ret %= mod;

			for(long s : f){
				mod = s;
				long rets = calc(r1, c1, r2, c2);
				if(rets >= 10000000000L){
					out.print("...");
					String rs = Long.toString(ret);
					for(int i = rs.length();i<10;i++){
						out.print("0");
					}
					out.println(rs);
//					out.printf("...%010d\n", ret);
					continue outer;
				}
			}
			out.println(ret);
		}
	}

	public static long mul(long a, long b)
	{
		while(a < 0)a+=mod;
		while(a >= mod)a-=mod;
		while(b < 0)b+=mod;
		while(b >= mod)b-=mod;
		long ret = 0;
		int x = 63-Long.numberOfLeadingZeros(b);
		for(;x >= 0;x--){
			ret += ret;
			if(ret >= mod)ret -= mod;
			if(b<<63-x<0){
				ret += a;
				if(ret >= mod)ret -= mod;
			}
		}
		return ret;
	}

	public static long c3(long r)
	{
		long a = r, b = r+1, c = 2*r+1;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	public static long q3(long r)
	{
		long a = r, b = r+1, c = r+2;
		if(a % 2 == 0){
			a /= 2;
		}else{
			b /= 2;
		}
		if(a % 3 == 0){
			a /= 3;
		}else if(b % 3 == 0){
			b /= 3;
		}else{
			c /= 3;
		}
		return mul(mul(a, b), c);
	}

	static long c2(long r)
	{
		if(r % 2 == 0){
			return mul(r/2, r+1);
		}else{
			return mul(r, (r+1)/2);
		}
	}

	static long c4(long r)
	{
		long v = c2(r);
		return mul(v, v);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new E().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.util.*;
import java.math.*;
public class Main{
	BigInteger q(BigInteger x){
		return x.multiply(x.add(BigInteger.ONE)).shiftRight(1);
	}
	BigInteger r(BigInteger x){
		return x.multiply(x.add(BigInteger.ONE)).multiply(x.shiftLeft(1).add(BigInteger.ONE)).divide(new BigInteger("6"));
	}
	BigInteger calc(BigInteger x,BigInteger y){
		if(x.compareTo(BigInteger.ZERO)==0 ||
		y.compareTo(BigInteger.ZERO)==0)return BigInteger.ZERO;
		if(x.compareTo(y)<=0){
			BigInteger res=q(x.multiply(x));
			y=y.subtract(x);
			res=res.add(q(x).multiply(y)).add(
			r(x.add(y).subtract(BigInteger.ONE)).subtract(
			r(x.subtract(BigInteger.ONE))
			).multiply(x));
			return res;
		}else{
			BigInteger res=q(y.multiply(y));
			x=x.subtract(y);
			res=res.add(
			r(y.add(x)).subtract(
			r(y)
			).multiply(y)).subtract(
			q(y.subtract(BigInteger.ONE)).multiply(x)
			);
			return res;
		}
	}
	void run()throws IOException{
		BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
		for(int _=Integer.parseInt(buf.readLine()); _>0; --_){
			StringTokenizer s=new StringTokenizer(buf.readLine());
			BigInteger ax = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
			BigInteger ay = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
			BigInteger bx = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());
			BigInteger by = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());
			String res=calc(ax,ay).add(calc(bx,by)).subtract(calc(ax,by)).subtract(calc(bx,ay)).toString();
			if(res.length()<=10)
				System.out.println(res);
			else
				System.out.println("..."+res.substring(res.length()-10));
		}
	}
	public static void main(String[]args)throws IOException{
		new Main().run();
	}
}


import java.io.*;
import java.util.*;
import java.math.*;
public class Main{
	BigInteger q(BigInteger x){
		return x.multiply(x.add(BigInteger.ONE)).shiftRight(1);
	}
	BigInteger r(BigInteger x){
		return x.multiply(x.add(BigInteger.ONE)).multiply(x.shiftLeft(1).add(BigInteger.ONE)).divide(new BigInteger("6"));
	}
	BigInteger calc(BigInteger x,BigInteger y){
		if(x.compareTo(BigInteger.ZERO)==0 ||
		y.compareTo(BigInteger.ZERO)==0)return BigInteger.ZERO;
		if(x.compareTo(y)<=0){
			BigInteger res=q(x.multiply(x));
			y=y.subtract(x);
			res=res.add(q(x).multiply(y)).add(
			r(x.add(y).subtract(BigInteger.ONE)).subtract(
			r(x.subtract(BigInteger.ONE))
			).multiply(x));
			return res;
		}else{
			BigInteger res=q(y.multiply(y));
			x=x.subtract(y);
			res=res.add(
			r(y.add(x)).subtract(
			r(y)
			).multiply(y)).subtract(
			q(y.subtract(BigInteger.ONE)).multiply(x)
			);
			return res;
		}
	}
	void run()throws IOException{
		BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
		for(int _=Integer.parseInt(buf.readLine()); _>0; --_){
			StringTokenizer s=new StringTokenizer(buf.readLine());
			BigInteger ax = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
			BigInteger ay = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-1).toString());
			BigInteger bx = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());
			BigInteger by = new BigInteger(new Integer(Integer.parseInt(s.nextToken())-0).toString());
			String res=calc(ax,ay).add(calc(bx,by)).subtract(calc(ax,by)).subtract(calc(bx,ay)).toString();
			if(res.length()<10)
				System.out.println(res);
			else
				System.out.println("..."+res.substring(res.length()-10));
		}
	}
	public static void main(String[]args)throws IOException{
		new Main().run();
	}
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static BigInteger calc(BigInteger x,BigInteger y){
		if(x.equals(BigInteger.ZERO) || y.equals(BigInteger.ZERO)) return BigInteger.ZERO;
		if(x.equals(y)){
			BigInteger b=x.multiply(x);
			return b.multiply(b.add(BigInteger.ONE)).divide(new BigInteger("2"));
		}else if(x.compareTo(y)<0){
			BigInteger b=x.multiply(x);
			BigInteger sum=b.multiply(b.add(BigInteger.ONE)).divide(new BigInteger("2"));
			sum=sum.add(x.multiply(x.add(BigInteger.ONE)).divide(new BigInteger("2")).multiply(y.subtract(x)));
			y=y.subtract(BigInteger.ONE);
			BigInteger A=y.multiply(y.add(BigInteger.ONE)).multiply(y.shiftLeft(1).add(BigInteger.ONE));
			BigInteger z=x.subtract(BigInteger.ONE);
			BigInteger B=z.multiply(z.add(BigInteger.ONE)).multiply(z.shiftLeft(1).add(BigInteger.ONE));
			return sum.add(A.subtract(B).divide(new BigInteger("6")).multiply(x));
		}else{
			BigInteger b=y.multiply(y);
			BigInteger sum=b.multiply(b.add(BigInteger.ONE)).divide(new BigInteger("2"));
			BigInteger A=y.multiply(y.add(BigInteger.ONE)).multiply(y.shiftLeft(1).add(BigInteger.ONE));
			BigInteger B=x.multiply(x.add(BigInteger.ONE)).multiply(x.shiftLeft(1).add(BigInteger.ONE));
			sum=sum.add(B.subtract(A).divide(new BigInteger("6")).multiply(y));
			return sum.subtract(y.multiply(y.subtract(BigInteger.ONE)).shiftRight(1).multiply(x.subtract(y)));
		}
	}
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		for( int i=0; i<n; i++ ){
			BigInteger x1=new BigInteger(sc.next()).subtract(BigInteger.ONE);
			BigInteger y1=new BigInteger(sc.next()).subtract(BigInteger.ONE);
			BigInteger x2=new BigInteger(sc.next());
			BigInteger y2=new BigInteger(sc.next());
			BigInteger s=calc(x2,y2).subtract(calc(x1,y2)).subtract(calc(x2,y1)).add(calc(x1,y1));
			String ss=s.toString();
			if(ss.length()>10){
				System.out.println("..."+ss.substring(ss.length()-10));
			}else{
				System.out.println(ss);
			}
		}
	}
}