#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mem(x,y) memset(x,y,sizeof(x))
#define MX 200005

ll A[MX], B[MX];

int main()
{
    int test;
    cin>>test;
    while(test--)
    {
      ll i,j,k,s,d,r,m,n,a,b,c,f=0;
       for(i=1; i<=3; i++) cin>>A[i];
       for(i=1; i<=5; i++) cin>>B[i];


       for(i=1; i<=3; i++) {A[i] = A[i]-B[i]; if(A[i]<0) f=1;}

       if(f)
       {
           cout<<"NO\n";
           continue;
       }

        d= min(A[1], B[4]);
        B[4] -= d;

        d= min(A[2], B[5]);
        B[5] -= d;

        if(B[4]+B[5]<= A[3]) cout<<"YES\n";
        else cout<<"NO\n";
    }
}

