#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if ((a || b) && x1 == x2) {
      cout << "NO" << endl;
      continue;
    }
    if ((c || d) && y1 == y2) {
      cout << "NO" << endl;
      continue;
    }
    int finx = x - a + b, finy = y - c + d;
    if (finx >= x1 && finx <= x2 && finy >= y1 && finy <= y2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
