#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    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;
    x1 -= x;
    x2 -= x;
    y1 -= y;
    y2 -= y;
    long long aa = min(a, b), bb = min(c, d);
    if (x1 == 0 && x2 == 0 && aa != 0) {
      cout << "No" << endl;
      continue;
    }
    if (y1 == 0 && y2 == 0 && bb != 0) {
      cout << "No" << endl;
      continue;
    }
    a -= aa;
    b -= aa;
    c -= bb;
    d -= bb;
    if (a > 0 && x1 * -1 < a) {
      cout << "No" << endl;
      continue;
    }
    if (b > 0 && x2 < b) {
      cout << "No" << endl;
      continue;
    }
    if (c > 0 && y1 * -1 < c) {
      cout << "No" << endl;
      continue;
    }
    if (d > 0 && y2 < d) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}
