I. Three Rectangles
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

A rectangular board with sides parallel to the coordinate axes lies on a two-dimensional plane. The bottom-left corner of the region is at coordinate $$$(0, 0)$$$ while the top-right corner is at coordinate $$$(H, W)$$$.

Given three rectangular cards, you need to put these three cards fully inside the board to cover the whole board and find the number of different placements. Here the cards should not be rotated or flipped, the sides of each card should be parallel to the coordinate axes, and the corners of each card should have integral coordinates.

Two placements are considered different if and only if there exists a card with different locations in the two placements. Since the answer may be large, output it modulo $$$10^9 + 7$$$.

Input

The input contains several test cases, and the first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^5$$$), denoting the number of test cases.

For each test case:

The first line contains two integers $$$H$$$ and $$$W$$$ ($$$1 \le H, W \le 10^9$$$), denoting the height and the width of the rectangular board.

Then three lines follow, the $$$i$$$-th of which contains two integers $$$h_i$$$ ($$$1 \le h_i \le H$$$) and $$$w_i$$$ ($$$1 \le w_i \le W$$$), denoting the height and the width of the $$$i$$$-th rectangular card.

Output

For each test case, output a line containing a single integer, indicating the number of different placements that satisfy the conditions, modulo $$$10^9 + 7$$$.

Examples
Input
5
2 2
1 1
1 1
1 1
2 2
1 1
1 2
1 2
2 2
1 1
1 2
2 1
2 2
1 2
1 2
1 2
2 2
1 2
1 2
2 1
Output
0
8
4
6
4
Input
4
1 3
1 1
1 2
1 3
1 4
1 1
1 2
1 3
1 5
1 1
1 2
1 3
1 6
1 1
1 2
1 3
Output
6
12
14
6
Input
1
1000000000 1000000000
1 1
1 1
1000000000 1000000000
Output
2401