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