#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
long long n, t, x, y, x1, x2, yy1, y2, a, b, c, d;
int main() {
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> yy1 >> x2 >> y2;
    if ((x1 == x2 && (a || b)) || ((yy1 == y2) && (c || d)) ||
        (x - a + b < x1) || (x - a + b > x2) || (y - c + d < yy1) ||
        (y - c + d > y2))
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
