#include<bits/stdc++.h>

using namespace std;

#define endl "\n"
#define lln long long int
#define ld long double
#define all(x) (x).begin(),(x).end()
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int MOD = 1e9 + 7;


int main(){
    IOS;

    int a1;
    cin >> a1;
    for(int TT=0;TT<a1;TT++){
        int c1, c2, c3;
        cin >> c1 >> c2 >> c3;
        int a1, a2, a3, a4, a5;
        cin >> a1 >> a2 >> a3 >> a4 >> a5;
        if(a1 > c1 || a2 > c2 || a3 > c3){
            cout << "NO\n";
            continue;
        }
        c1 -= a1; c2 -= a2; c3 -= a3;
        if(a4 > c1 + c3){
            cout << "NO\n";
            continue;
        }
        c3 -= max(0,a4 - c1);
        if(a5 > c2 + c3){
            cout << "NO\n";
            continue;
        }
        cout << "YES\n";
    }
    return 0;    
}