#include <bits/stdc++.h>
using namespace std;
long long xyp(long long x, long long y) {
  if (y == 0) return 1LL;
  if (y == 1) return x;
  if (y % 2) {
    long long p = xyp(x, y - 1);
    return (x * p) % 1000000007;
  }
  long long p = xyp(x, y / 2);
  return (p * p) % 1000000007;
}
long long inv(long long x) { return xyp(x, 1000000007 - 2); }
long long fact[10000007];
long long pr[10000007];
vector<long long> rp;
void init() {
  fact[0] = 1;
  for (long long i = 1; i < 10000007; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
}
long long ncr(long long n, long long r) {
  if (r < 0) return 0LL;
  if (r == 0 || n == r) return 1LL;
  if (r == 1 || ((n - r) == 1)) return n;
  long long p =
      (((fact[n] * inv(fact[r])) % 1000000007) * inv(fact[n - r])) % 1000000007;
  return p;
}
void sieve() {
  memset(pr, 1, sizeof(pr));
  pr[0] = pr[1] = 0;
  for (long long i = 2; i < 10000007; i++) {
    if (pr[i]) {
      rp.push_back(i);
      for (long long j = i * i; j < 10000007; j += i) {
        pr[j] = 0;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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;
    long long dxl = abs(x1 - x), dxr = abs(x2 - x);
    long long dyl = abs(y1 - y), dyr = abs(y2 - y);
    long long maxX = max(dxl, dxr);
    long long maxY = max(dyl, dyr);
    long long flag = 1;
    if (a > b) {
      a = max(abs(a - b), 1LL);
      if (dxl < a) flag = 0;
    } else if (a < b) {
      b = max(abs(b - a), 1LL);
      if (dxr < b) flag = 0;
    } else {
      if (a == 0 && b == 0) {
      } else {
        a = 1LL;
        b = 1LL;
        if (dxl < a && dxr < b) flag = 0;
      }
    }
    swap(a, c);
    swap(b, d);
    swap(dxl, dyl);
    swap(dxr, dyr);
    if (a > b) {
      a = max(abs(a - b), 1LL);
      if (dxl < a) flag = 0;
    } else if (a < b) {
      b = max(abs(b - a), 1LL);
      if (dxr < b) flag = 0;
    } else {
      if (a == 0 && b == 0) {
      } else {
        a = 1LL;
        b = 1LL;
        if (dxl < a && dxr < b) flag = 0;
      }
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
