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