#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int l, r, u, d, x, x1, y, y1, x2, y2;
    cin >> l >> r >> d >> u;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 && (l > 0 || r > 0)) {
      cout << "NO"
           << "\n";
    } else if (y1 == y2 && (d > 0 || u > 0))
      cout << "NO"
           << "\n";
    else {
      x = x + r - l;
      y = y + u - d;
      if (x > x2 || x < x1)
        cout << "NO"
             << "\n";
      else if (y > y2 || y < y1)
        cout << "NO"
             << "\n";
      else
        cout << "YES"
             << "\n";
    }
  }
  return 0;
}
