#include <bits/stdc++.h>
using namespace std;
static auto _ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  return 0;
}();
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    long long horizontal = b - a;
    long long vertical = d - c;
    bool f = true;
    if (x1 == x && x == x2 && (a > 0 || b > 0)) {
      f = false;
    }
    if (y1 == y && y == y2 && (c > 0 || d > 0)) {
      f = false;
    }
    if (horizontal > 0) {
      if (x2 - x < +horizontal) {
        f = false;
      }
    } else {
      if (x - x1 < -horizontal) {
        f = false;
      }
    }
    if (vertical > 0) {
      if (y2 - y < +vertical) {
        f = false;
      }
    } else {
      if (y - y1 < -vertical) {
        f = false;
      }
    }
    if (f) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
