Recently, Masha was presented with a chessboard with a height of n and a width of m.

The rows on the chessboard are numbered from 1 to n from bottom to top. The columns are numbered from 1 to m from left to right. Therefore, each cell can be specified with the coordinates (x,y), where x is the column number, and y is the row number (do not mix up).

Let us call a rectangle with coordinates (a,b,c,d) a rectangle lower left point of which has coordinates (a,b), and the upper right one — (c,d).

The chessboard is painted black and white as follows:

<image> An example of a chessboard.

Masha was very happy with the gift and, therefore, invited her friends Maxim and Denis to show off. The guys decided to make her a treat — they bought her a can of white and a can of black paint, so that if the old board deteriorates, it can be repainted. When they came to Masha, something unpleasant happened: first, Maxim went over the threshold and spilled white paint on the rectangle (x_1,y_1,x_2,y_2). Then after him Denis spilled black paint on the rectangle (x_3,y_3,x_4,y_4).

To spill paint of color color onto a certain rectangle means that all the cells that belong to the given rectangle become color. The cell dyeing is superimposed on each other (if at first some cell is spilled with white paint and then with black one, then its color will be black).

Masha was shocked! She drove away from the guests and decided to find out how spoiled the gift was. For this, she needs to know the number of cells of white and black color. Help her find these numbers!

Input

The first line contains a single integer t (1 ≤ t ≤ 10^3) — the number of test cases.

Each of them is described in the following format:

The first line contains two integers n and m (1 ≤ n,m ≤ 10^9) — the size of the board.

The second line contains four integers x_1, y_1, x_2, y_2 (1 ≤ x_1 ≤ x_2 ≤ m, 1 ≤ y_1 ≤ y_2 ≤ n) — the coordinates of the rectangle, the white paint was spilled on.

The third line contains four integers x_3, y_3, x_4, y_4 (1 ≤ x_3 ≤ x_4 ≤ m, 1 ≤ y_3 ≤ y_4 ≤ n) — the coordinates of the rectangle, the black paint was spilled on.

Output

Output t lines, each of which contains two numbers — the number of white and black cells after spilling paint, respectively.

Example

Input


5
2 2
1 1 2 2
1 1 2 2
3 4
2 2 3 2
3 1 4 3
1 5
1 1 5 1
3 1 5 1
4 4
1 1 4 2
1 3 4 4
3 4
1 2 4 2
2 1 3 3


Output


0 4
3 9
2 3
8 8
4 8

Note

Explanation for examples:

The first picture of each illustration shows how the field looked before the dyes were spilled. The second picture of each illustration shows how the field looked after Maxim spoiled white dye (the rectangle on which the dye was spilled is highlighted with red). The third picture in each illustration shows how the field looked after Denis spoiled black dye (the rectangle on which the dye was spilled is highlighted with red).

In the first test, the paint on the field changed as follows:

<image>

In the second test, the paint on the field changed as follows:

<image>

In the third test, the paint on the field changed as follows:

<image>

In the fourth test, the paint on the field changed as follows:

<image>

In the fifth test, the paint on the field changed as follows:

<image>
import java.io.*;
import java.util.StringTokenizer;

public class UpSolving {
	public static void main(String[] args) throws IOException, InterruptedException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int t = sc.nextInt();
		while (t-- > 0) {
			long x = sc.nextLong();
			long y = sc.nextLong();
			long a = x * y;
			long black = a / 2;
			long white = (a & 1) == 0 ? a / 2 : a / 2 + 1;
			long x1 = sc.nextLong();
			long y1 = sc.nextLong();
			long x2 = sc.nextLong();
			long y2 = sc.nextLong();
			long x3 = sc.nextLong();
			long y3 = sc.nextLong();
			long x4 = sc.nextLong();
			long y4 = sc.nextLong();
			long h1 = x2 - x1 + 1;
			long h2 = x4 - x3 + 1;
			long w1 = y2 - y1 + 1;
			long w2 = y4 - y3 + 1;
			a = h1 * w1;
			long nWhite = 0;
			if (((x1 + y1) & 1) == 0 || (a & 1) == 0)
				nWhite = a / 2;
			else
				nWhite = a / 2 + 1;
			a = h2 * w2;
			long nBlack = 0;
			if (((x3 + y3) & 1) != 0 || (a & 1) == 0)
				nBlack = a / 2;
			else
				nBlack = a / 2 + 1;
			long x5 = x3 > x1 ? x3 : x1;
			long y5 = y3 > y1 ? y3 : y1;
			long x6 = x4 > x2 ? x2 : x4;
			long y6 = y4 > y2 ? y2 : y4;
			if ((y6 - y5 + 1) > 0 && (x6 - x5 + 1) > 0) {
				a = (x6 - x5 + 1) * (y6 - y5 + 1);
				if (((a & 1) == 0) || ((x5 + y5) & 1) == 0)
					nWhite -= a / 2;
				else
					nWhite -= (a / 2 + 1);
			}
			pw.println(white + nWhite - nBlack + " " + (black + nBlack - nWhite));
		}
		pw.flush();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(4000);
		}
	}
}
