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