// In the name of god let's gooooooooooooooooooooo
#include <bits/stdc++.h>

using namespace std;
// Variables __________________________________________________________
int c1,c2,c3,a1,a2,a3,a4,a5;
bool ans = false;
int q;
// Functions __________________________________________________________
void input(){
	cin >> c1 >> c2 >> c3 >> a1 >> a2 >> a3 >> a4 >> a5;
}
void solve(){
	if(c1 >= a1 && c2 >= a2 && c3 >= a3){
		c1 -= a1;
		c2 -= a2;
		c3 -= a3;
		if(c1 >= a4){
			if(c2 + c3 >= a5)
				ans = true;
		}
		else{
			if(c1 + c3 >= a4){
				c3 -= a4-c1;
				if(c2 + c3 >= a5)
					ans = true;
			}
		}
	}
	if(ans)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void output(){
}
// Main _______________________________________________________________
int main(){
	ios_base::sync_with_stdio(0),cin.tie(),cout.tie();
	cin >> q;
	for(int i=0;i<q;i++){
		input();
		solve();
		ans = false;
	}
	output();
	return 0;
}

