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