#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long 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;
    if (x == x1 && x == x2 && (a >= 1 || b >= 1)) {
      cout << "No\n";
      continue;
    }
    if (y == y1 && y == y2 && (c >= 1 || d >= 1)) {
      cout << "No\n";
      continue;
    }
    int minAB = min(a, b);
    int minCD = min(c, d);
    a -= minAB;
    b -= minAB;
    c -= minCD;
    d -= minCD;
    if (a > 0) {
      x -= a;
    } else {
      x += b;
    }
    if (c > 0) {
      y -= c;
    } else {
      y += d;
    }
    if (x1 <= x && x <= x2 && y1 <= y && y <= y2) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
