G. enCAMAdo
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

We are playing "Twister" with Echomel, but he is a dirty cheater, and we believe not all his limbs are inside the game panel.

You are given two pairs of integers representing the coordinates of the bottom-left and top-right corners of the Twister panel, respectively. The game panel is a rectangle.

Next, you will be given 4 pairs of integers, representing the coordinates where Echomel has placed his left hand, right hand, left foot, and right foot, respectively.

Note 1: Echomel is VERY flexible.

Input

The first line contains an integer $$$t$$$, $$$(1 \le t \le 1000)$$$.

The first line for each case contains the coordinates of the rectangle $$$x1, y1, x2, y2$$$, $$$(-10^9 \le x1, y1, x2, y2 \le 10^9)$$$, $$$(x1 \lt x2)$$$ y $$$(y1 \lt y2)$$$.

The first line for each case contains the coordinates of Echomel's hands and feet $$$mi_x, mi_y, md_x, md_y$$$, $$$pi_x, pi_y, pd_x, pd_y$$$, $$$(-10^9 \le mi_x, mi_y, md_x, md_y$$$, $$$pi_x, pi_y, pd_x, pd_y \le 10^9)$$$ — The coordinates of each hand and foot.

$$$m = hand$$$, $$$p = foot$$$, $$$i = left$$$, $$$d = right$$$.

Output

Print YES if Echomel is playing legitimately; otherwise, he will need to be punished, so print NO if Echomel is being a bad boy, both responses without quotes.

Example
Input
2
1 1 5 5
1 5 5 5 1 1 1 5
2 2 3 4
2 2 3 4 4 4 0 1
Output
YES
NO