#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int x, y, x1, y1, x2, y2, l = 0, r = 0, u = 0, dd = 0, flag = 0;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (a > b) {
      l = a - b;
      if (x - l < x1) {
        flag = 1;
      } else if (x == x1 && x == x2) {
        flag = 1;
      }
    } else if (b > a) {
      r = b - a;
      if (r + x > x2) {
        flag = 1;
      } else if (x == x1 && x == x2) {
        flag = 1;
      }
    } else {
      if (x == x1 && x == x2 && a > 0) {
        flag = 1;
      }
    }
    if (c > d) {
      dd = c - d;
      if (y - dd < y1) {
        flag = 1;
      } else if (y == y1 && y == y2) {
        flag = 1;
      }
    } else if (d > c) {
      u = d - c;
      if (u + y > y2) {
        flag = 1;
      } else if (y == y1 && y == y2) {
        flag = 1;
      }
    } else {
      if (y == y1 && y == y2 && c > 0) {
        flag = 1;
      }
    }
    if (flag == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
