#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

void solve(){
    vector<ll> c(4);
    for(int i = 1;i <= 3;i++){
        cin>>c[i];
    }
    vector<ll> a(6);
    for(int i = 1;i <= 5;i++){
        cin>>a[i];
    }

    bool ok = true;

    for(int i = 1;i <= 3;i++){
        c[i] -= a[i];
        if(c[i] < 0) ok = false;
    }
    a[4] -= min(c[1],a[4]);
    c[1] -= min(c[1],a[4]);

    c[3] -= a[4];
    if(c[3] < 0) ok = false;

    a[5] -= min(c[2],a[5]);
    c[2] -= min(c[2],a[5]);

    c[3] -= a[5];
    if(c[3] < 0 ) ok = false;
    if(ok) cout<<"YES\n";
    else cout<<"NO\n";
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--) solve();
    return 0;
}
