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