#include <bits/stdc++.h>
using namespace std;
long long int mods(long long int x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    long long int x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if ((x + b - a >= x1 && x + b - a <= x2) &&
        (y + d - c >= y1 && y + d - c <= y2)) {
      if ((a == b && x1 == x2 && a != 0) || (c == d && y1 == y2 && c != 0))
        cout << "NO";
      else
        cout << "YES";
    } else {
      cout << "NO";
    }
    cout << endl;
  }
}
