#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
	    int c[3],a[5];
	    for(int i=0;i<3;i++)cin>>c[i];
	    for(int i=0;i<5;i++)cin>>a[i];
	    bool hai = true;
	    if(c[0]<a[0] || c[1]<a[1] || c[2]<a[2])
	    {
	        cout<<"NO\n";
	        continue;
	    }
	    c[0]-=a[0];
	    c[1]-=a[1];
	    c[2]-=a[2];
	    int mini = min(c[0],a[3]);
	    c[0]-=mini;
	    a[3]-=mini;
	    mini = min(c[1],a[4]);
	    c[1]-=mini;
	    a[4]-=mini;
	    if(a[3]+a[4]>c[2])
	    {
	        cout<<"NO\n";
	        continue;
	    }
	    cout<<"YES\n";
	}
	return 0;
}
