Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! 

Initially, Alice's cat is located in a cell $(x,y)$ of an infinite grid. According to Alice's theory, cat needs to move:   exactly $a$ steps left: from $(u,v)$ to $(u-1,v)$;  exactly $b$ steps right: from $(u,v)$ to $(u+1,v)$;  exactly $c$ steps down: from $(u,v)$ to $(u,v-1)$;  exactly $d$ steps up: from $(u,v)$ to $(u,v+1)$. 

Note that the moves can be performed in an arbitrary order. For example, if the cat has to move $1$ step left, $3$ steps right and $2$ steps down, then the walk right, down, left, right, right, down is valid.

Alice, however, is worrying that her cat might get lost if it moves far away from her. So she hopes that her cat is always in the area $[x_1,x_2]\times [y_1,y_2]$, i.e. for every cat's position $(u,v)$ of a walk $x_1 \le u \le x_2$ and $y_1 \le v \le y_2$ holds.

Also, note that the cat can visit the same cell multiple times.

Can you help Alice find out if there exists a walk satisfying her wishes?

Formally, the walk should contain exactly $a+b+c+d$ unit moves ($a$ to the left, $b$ to the right, $c$ to the down, $d$ to the up). Alice can do the moves in any order. Her current position $(u, v)$ should always satisfy the constraints: $x_1 \le u \le x_2$, $y_1 \le v \le y_2$. The staring point is $(x, y)$.

You are required to answer $t$ test cases independently.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^3$) — the number of testcases. 

The first line of each test case contains four integers $a$, $b$, $c$, $d$ ($0 \le a,b,c,d \le 10^8$, $a+b+c+d \ge 1$).

The second line of the test case contains six integers $x$, $y$, $x_1$, $y_1$, $x_2$, $y_2$ ($-10^8 \le x_1\le x \le x_2 \le 10^8$, $-10^8 \le y_1 \le y \le y_2 \le 10^8$).


-----Output-----

For each test case, output "YES" in a separate line, if there exists a walk satisfying her wishes. Otherwise, output "NO" in a separate line. 

You can print each letter in any case (upper or lower).


-----Example-----
Input
6
3 2 2 2
0 0 -2 -2 2 2
3 1 4 1
0 0 -1 -1 1 1
1 1 1 1
1 1 1 1 1 1
0 0 0 1
0 0 0 0 0 1
5 1 1 1
0 0 -100 -100 0 100
1 1 5 1
0 0 -100 -100 100 0

Output
Yes
No
No
Yes
Yes
Yes



-----Note-----

In the first test case, one valid exercising walk is $$(0,0)\rightarrow (-1,0) \rightarrow (-2,0)\rightarrow (-2,1) \rightarrow (-2,2)\rightarrow (-1,2)\rightarrow(0,2)\rightarrow (0,1)\rightarrow (0,0) \rightarrow (-1,0)$$

Difficulty: interview

Starter code:

Solutions:
from math import *
for t in range(int(input())):
    a, b, c, d = map(int, input().split())
    x, y, x1, y1, x2, y2 = map(int, input().split())
    x += b - a
    y += d - c
    if (x < x1 or x > x2 or y < y1 or y > y2):
        print("No")
        continue
    if x1 == x2 and x1 == x and (a != 0 or b != 0):
        print("No")
        continue
    if y1 == y2 and y1 == y and (c != 0 or d != 0):
        print("No")
        continue
    print("Yes")

for _ in range(int(input())):
    a, b, c, d = map(int, input().split())
    x, y, x1, y1, x2, y2 = map(int, input().split())
    if x != x1 or x!=x2:
        temp = min(a, b)
        a -= temp
        b -= temp
    if y != y1 or y!=y2:
        temp = min(c, d)
        c -= temp
        d -= temp
    flag = 0
    if a > 0:
        if x - a < x1:
            flag = 1
    if b > 0:
        if x + b > x2:
            flag = 1
    if c > 0:
        if y - c < y1:
            flag = 1
    if d > 0:
        if y + d > y2:
            flag = 1
    if flag:
        print("No")
    else:
        print("Yes")

for _ in range(int(input())):
    a, b, c, d = map(int, input().split())
    x, y, x1, y1, x2, y2 = map(int, input().split())
    x += b - a
    y += d - c
    valid = x1 <= x <= x2 and y1 <= y <= y2
    if x1 == x2: valid &= a == 0 and b == 0
    if y1 == y2: valid &= c == 0 and d == 0

    print(["No", "Yes"][valid])

q = int(input())
for rwerew in range(q):
	a,b,c,d = map(int,input().split())
	x,y,x1,y1,x2,y2 = map(int,input().split())
	if x1==x2 and (a>0 or b>0):
		print("No")
	else:
		if y1==y2 and (c>0 or d>0):
			print("No")
		else:
			if x2-x >= b-a and y2 - y >= d - c and x-x1 >= a-b and y-y1 >= c-d:
				print("Yes")
			else:
				print("No")

import sys
input = sys.stdin.readline

for _ in range(int(input())):
    left, right, up, down = list(map(int, input().split()))
    x, y, x1, y1, x2, y2 = list(map(int, input().split()))

    if (left or right) and (x1 == x2) or (up or down) and (y1 == y2):
        print('No')
        continue
    if (x1 <= x + (right - left) <= x2) and (y1 <= y + (down - up) <= y2):
        print('Yes')
    else:
        print('No')


def solve():
    a,b,c,d = map(int,input().split())
    x,y,x1,y1,x2,y2 = map(int,input().split())
    dx = b-a
    dy = d-c
    if x1==x2:
        if a+b:
            print('No')
            return
    if y1==y2:
        if c+d:
            print('No')
            return
    if x1<=x+dx<=x2 and y1<=y+dy<=y2:
        print('Yes')
    else:
        print('No')
def __starting_point():
    t = int(input())
    for _ in range(t):
        solve()
__starting_point()

t=int(input())
for i in range(t):
    a,b,c,d=list(map(int,input().split()))
    x,y,x1,y1,x2,y2=list(map(int,input().split()))
    x+=b-a
    y+=d-c
    u=a+b
    e=c+d
    if x>=x1 and x<=x2 and y<=y2 and y>=y1 and not(u!=0 and x1==x2) and not(e!=0 and y1==y2):
        print("Yes")
    else:
        print("No")


t = int(input())
for case_num in range(t):
    a, b, c, d = list(map(int, input().split(' ')))
    x, y, x1, y1, x2, y2 = list(map(int, input().split(' ')))
    ok = True
    if a > b:
        delta = a - b
        if x - x1 < delta:
            ok = False
    elif a == b and a > 0:
        if x == x1 and x == x2:
            ok = False
    else:
        delta = b - a
        if x2 - x < delta:
            ok = False

    if c > d:
        delta = c - d
        if y - y1 < delta:
            ok = False
    elif c == d and c > 0:
        if y == y1 and y == y2:
            ok = False
    else:
        delta = d - c
        if y2 - y < delta:
            ok = False

    print('Yes' if ok else 'No')


for q in range(int(input())):
    l, r, d, u = [int(i) for i in input().split()]
    x, y, x1, y1, x2, y2 =  [int(i) for i in input().split()]
    if (l+r>0 and x1 == x2) or (u+d>0 and y1==y2):
        print("No")
        continue
    x += r - l
    y += u - d
    if (x >= x1 and x <= x2 and y >= y1 and y <= y2):
        print("Yes")
    else:
        print("No")