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