#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int t, a, b, c, d, x, y, x1, x2, y1, y2, res = 1;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    res = 1;
    if (x1 == x2)
      if (a or b) {
        cout << "NO" << endl;
        continue;
      }
    if (y1 == y2)
      if (c or d) {
        cout << "NO" << endl;
        continue;
      }
    if (a > b) {
      if (a - b > x - x1) res = 0;
    } else {
      if (b - a > x2 - x) res = 0;
    }
    if (c > d) {
      if (c - d > y - y1) res = 0;
    } else {
      if (d - c > y2 - y) res = 0;
    }
    if (res)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
