#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll tc;cin>>tc;while(tc--)
    {
        ll c1,c2,c3;
        cin>>c1>>c2>>c3;
        ll a1,a2,a3,a4,a5;
        cin>>a1>>a2>>a3>>a4>>a5;
        ll p1=0,p2=0,p3=0;
        c1=c1-a1;c2=c2-a2;c3=c3-a3;
       // cout<<"c1="<<c1<<"c2="<<c2<<"c3="<<c3<<endl;
        if(c1<0 || c2<0 || c3<0) cout<<"NO"<<endl;
        else
        {
            c1=c1-a4;
            if(c1<0)
            {
                a4=(-1)*c1;
                c3=c3-a4;
            }
            if(c3<0) cout<<"NO"<<endl;
            else if((c2+c3)>=a5) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        }
    }
    return 0;
}
