#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, a, b, c, d, x, y, x1, x2, y1, y2, minl, minr, minu, mind;
  cin >> t;
  while (t--) {
    int flag = 0;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    long long int fx = x + b - a;
    long long int fy = y + d - c;
    if (!(x1 <= fx && fx <= x2 && y1 <= fy && fy <= y2)) {
      flag = 0;
      cout << "NO" << '\n';
    } else {
      if ((x1 == x2 && a != 0) || (y1 == y2 && c != 0)) {
        cout << "NO" << '\n';
      } else
        cout << "YES" << '\n';
    }
  }
}
