#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <fstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <iterator>
#include <iomanip>
#include <bitset>
#include <complex>
#include <unordered_set>
#include <unordered_map>
#define ll long long int
using namespace std;
#define N 200010
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("answer.txt", "w", stdout);
#endif 
    ll t;
    cin>>t;
    while(t--)
    {
        ll x,y,z;
        cin>>x>>y>>z;
        ll a[5];
        for(int i=0; i<5;i++)
        {
          cin>>a[i];
        }
        ll sum1=a[0]+a[3];
        ll sum2=a[1]+a[4];
        ll sum3=a[2];
        if(a[0]>x or a[1]>y or a[2]>z)
        {
          cout<<"NO"<<endl;
          continue;
        }
        else if(sum1>x+z)
        {
          cout<<"NO"<<endl;
          continue;
        }
        else if(sum2>y+z)
        {
          cout<<"NO"<<endl;
          continue;
        }
        else if(sum3>z)
        {
          cout<<"NO"<<endl;
          continue;
        }
        ll l=0;
        sum1=max(l,(sum1-x));
        sum2=max(l,(sum2-y));
        if(sum1+sum2+sum3>z)
        {
          cout<<"NO"<<endl;
          continue;
        }
        cout<<"YES"<<endl;
    }
}