#include <iostream>

using namespace std;

int main()
{
    long long t;
    cin>>t;
    while (t--)
    {
        long long c1,c2,c3,a1,a2,a3,a4,a5;
        cin>>c1>>c2>>c3>>a1>>a2>>a3>>a4>>a5;
        if (a1>c1||a2>c2||a3>c3)
        {
            cout<<"NO"<<endl;
            continue;
        }
        c1-=a1;
        c2-=a2;
        c3-=a3;
        //long long int x=c1+c3;
        a4-=c1;
        a5-=c2;
        if (a4>0)
        {
            c3-=a4;
        }
        if (a5>0)
        {
            c3-=a5;
        }
        if (c3>=0)
        {
            cout<<"YES"<<endl;
        }
        else {cout<<"NO"<<endl;}
    }
}
