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