#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define scanf scanf_s
using namespace std;
int main()
{
	int t,m,s;
	cin >> t;
	int  a[3],b[5],c[3];
	int count = 0;
	while (t--) {
		count = 0;
		for (int i = 0; i < 3; i++) {
			cin >> a[i];
		}
		for (int i = 0; i < 5; i++) {
			cin >> b[i];
		}
		
		if (a[0] < b[0]) {
			cout << "NO" << endl;
			count = 1;
		}else
		if (a[1] < b[1]) {
			cout << "NO" << endl;
			count = 1;
		}else
		if (b[2] > a[2]) {
			cout << "NO" << endl;
			count = 1;
		}
		if (count == 0) {
			if (a[0] - b[0] > 0) {
				s = a[0] - b[0];
				if (b[3] > s) {
					b[3] = b[3] - s;
				}
				else {
					b[3] = 0;
				}

			}
			if (a[1] - b[1] > 0) {
				s = a[1] - b[1];
				if (b[4] > s) {
					b[4] = b[4] - s;
				}
				else {
					b[4] = 0;
				}

			}
			if ((b[2] + b[3] + b[4]) <= a[2]) {
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}
	}
}