#include <bits/stdc++.h>
using namespace std;
void print(int i) { cout << (i ? "YES\n" : "NO\n"); }
void solve() {
  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 (!(x1 <= x && x <= x2 && y1 <= y && y <= y2)) {
    print(0);
    return;
  }
  int xFinal = a - b;
  int yFinal = c - d;
  int d1 = x - xFinal;
  int d2 = y - yFinal;
  if (x1 <= d1 && d1 <= x2 && y1 <= d2 && d2 <= y2 &&
      (((!a && !b) || (x2 - x1)) && ((!c && !d) || y2 - y1)))
    print(1);
  else
    print(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  cin >> tests;
  while (tests--) solve();
  return 0;
}
