#include <bits/stdc++.h>
using namespace std;
int _;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (cin >> _; _; _--) {
    int a, b, c, d;
    int x, y, x1, y1, x2, y2;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if ((x1 == x && x2 == x && a + b) || (y1 == y && y2 == y && c + d)) {
      cout << "NO" << endl;
      continue;
    }
    int r = b - a;
    int u = d - c;
    if (b - a <= x2 - x && d - c <= y2 - y && a - b <= x - x1 &&
        c - d <= y - y1) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
