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