#include <bits/stdc++.h>
using namespace std;
int main() {
  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;
    int temp = b - a;
    if (x + temp < x1 || x + temp > x2 || (x1 == x2 && (b > 0 || a > 0))) {
      cout << "NO" << endl;
      continue;
    }
    temp = d - c;
    if (y + temp < y1 || y + temp > y2 || (y1 == y2 && (c > 0 || d > 0))) {
      cout << "NO" << endl;
      continue;
    }
    cout << "YES" << endl;
  }
  return 0;
}
