#include <bits/stdc++.h>
#define ll long long
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MOD 998244353
#define EN '\n'
#define vc vector
#define pr pair <ll,ll>
#define eps 0.0000001
#define m(s ,e) ((s) + (e)) / 2;
#define wrp(p) for(auto it : (p)) cout << it.first << " " << it.second << EN;
#define wrv(p) for(auto it : (p)) cout << it << " ";
#define df(v, n) (v) = vc <vc <ll>> ((n) + 2)
#define rst(arr,val , n) for (ll i = 0 ; i <= n + 1 ; i++) (arr[i]) = val;
#define inf 1e15
#define pd pair <double , double>
#define dff(v , n) (v) = vc <ll> (1 << (ll)(1 + ceil(log2((n)))))
using namespace std;
ll c[5];
ll a[10];
bool chk(){
    bool ch = 0;
    for(ll i = 1; i <= 3; i++)
        ch |= c[i] < 0;
    return ch;
}
int main(){
    fastio;
    ll tc;
    cin >> tc;
    while(tc--){
        for(ll i = 1 ; i<= 3; i++)
            cin >> c[i];
        for(ll i = 1 ; i <= 5 ; i++)
            cin >> a[i];
        for(ll i = 1; i <= 3 ; i++)
            c[i] -= a[i];
        if(chk()){
            cout << "NO\n";
            continue;
        }
        if(a[4] > c[1])
            a[4] -= c[1];
        else
            a[4] =0;
        if (a[5] > c[2])
            a[5] -= c[2];
        else
            a[5] = 0;
        if(a[4] + a[5] > c[3])
            cout << "NO";
        else
            cout << "YES";
        cout << EN;
        
    }
    return 0;
}