#include<iostream>
using namespace std;
int main(){
	long long t,c[4],a[6],i,j,pd;
	cin>>t;
	while(t--){
		for(i=1;i<=3;i++) cin>>c[i];
		for(i=1,pd=0;i<=5;i++){
			cin>>a[i];
			if(i<=3){
				c[i]-=a[i];
				if(c[i]<0) pd=1;
			}
		}
		if(pd==1){
			cout<<"NO"<<endl;
			continue;
		}
		a[4]=max((long long)(0),a[4]-c[1]);
		a[5]=max((long long)(0),a[5]-c[2]);
		if(a[4]+a[5]<=c[3]) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
    return 0;
}