#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int k, l, m, n, x, y, x1, y1, x2, y2, p = 0, q = 0;
    cin >> k >> m >> l >> n >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 && k + m > 0)
      cout << "NO";
    else if (y1 == y2 && l + n > 0)
      cout << "NO";
    else {
      if (k > m && x - (k - m) < x1)
        cout << "NO";
      else if (m > k && x + (m - k) > x2)
        cout << "NO";
      else
        p = 1;
      if (p == 1) {
        if (l > n && y - (l - n) < y1)
          cout << "NO";
        else if (n > l && y + (n - l) > y2)
          cout << "NO";
        else
          q = 1;
      }
      if (p == 1 && q == 1) cout << "YES";
    }
    cout << endl;
  }
  return 0;
}
