Read problems statements in [Mandarin Chinese], [Russian], [Vietnamese] and [Bengali] as well.

Ash is trying to get visa to Chefland. For the visa to be approved, he needs to satisfy the following three criteria:
Solve at least $x_{1}$ problems on Codechef.
Have at least $y_{1}$ current rating on Codechef.
Make his last submission at most $z_{1}$ months ago.

You are given the number of problems solved by Chef ($x_{2}$), his current rating ($y_{2}$) and the information that he made his last submission $z_{2}$ months ago. Determine whether he will get the visa.

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first and only line of each test case contains six space-separated integers $x_{1}$, $x_{2}$, $y_{1}$, $y_{2}$, $z_{1}$ and $z_{2}$.

------  Output ------
For each test case, print a single line containing the string "YES" if Chef will get the visa or "NO" if he will not.

You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).

------  Constraints ------
$1 ≤ T ≤ 5,000$
$20 ≤ x_{1}, x_{2} ≤ 50$
$1,900 ≤ y_{1}, y_{2} ≤ 2,100$
$1 ≤ z_{1}, z_{2} ≤ 6$

----- Sample Input 1 ------ 
4
20 50 2100 1900 6 6
50 20 1900 1900 5 5
20 20 1900 1900 1 6
27 27 1920 1920 3 3
----- Sample Output 1 ------ 
NO
NO
NO
YES
----- explanation 1 ------ 
Example case 1: Chef's rating is less than the minimum required rating.

Example case 2: Chef has solved a smaller number of problems than the minimum required number.

Example case 3: Chef's last submission was made before the allowed period.

Example case 4: All three conditions are met.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
for _testcase in range(int(input())):
	(a, b, c, d, e, f) = map(int, input().split())
	if b >= a and d >= c and (f <= e):
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	n = input()
	c = n.split(' ')
	a = 0
	if c[3] >= c[2]:
		a += 1
	if c[0] <= c[1]:
		a += 1
	if c[5] <= c[4]:
		a += 1
	if a == 3:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x1, x2, y1, y2, z1, z2) = map(int, input().split())
	if x2 >= x1 and y2 >= y1 and (z2 <= z1):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(m, n, o, p, q, r) = map(int, input().split())
	if m <= n and o <= p and (q >= r):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, x1, y, y1, z, z1) = map(int, input().split())
	if x <= x1 and y <= y1 and (z >= z1):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x1, x2, y1, y2, z1, z2) = [int(x1) for x1 in input().split()]
	if x1 <= x2 and y1 <= y2 and (z1 >= z2):
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	(x1, x2, y1, y2, z1, z2) = map(int, input().split())
	if x2 >= x1 and y2 >= y1 and (z2 <= z1):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, a, y, b, z, c) = map(int, input().split())
	if a >= x and b >= y and (c <= z):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b, c, d, e, f) = list(map(int, input().split(' ')))
	if a <= b and c <= d and (e >= f):
		print('YES')
	else:
		print('NO')


d = int(input())
for i in range(d):
	(w1, w2, a1, a2, r1, r2) = [int(w1) for w1 in input().split()]
	if w1 <= w2 and a1 <= a2 and (r1 >= r2):
		print('YES')
	else:
		print('NO')


testcases = int(input())
for i in range(testcases):
	(X1, X2, Y1, Y2, Z1, Z2) = map(int, input().split())
	if X1 <= X2 and Y1 <= Y2 and (Z1 >= Z2):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	(x1, x2, y1, y2, z1, z2) = map(int, input().split())
	if x1 <= x2 and y1 <= y2 and (z1 >= z2):
		print('YES')
	else:
		print('NO')


def code():
	cases = int(input())
	for _ in range(cases):
		(x1, x2, y1, y2, z1, z2) = map(int, input().split(' '))
		criteria_met = 0
		if x2 >= x1:
			criteria_met += 1
		if y2 >= y1:
			criteria_met += 1
		if z1 >= z2:
			criteria_met += 1
		if criteria_met == 3:
			print('YES')
		else:
			print('NO')
code()


n = int(input())
for i in range(n):
	(a, b, c, d, e, f) = [int(k) for k in input().split()]
	if a <= b and c <= d and (e >= f):
		print('YES')
	else:
		print('NO')