#include <bits/stdc++.h>
using namespace std;
int main() {
  long test;
  cin >> test;
  while (test--) {
    long l, r, d, u;
    cin >> l >> r >> d >> u;
    long x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if ((x1 - x == 0 && x2 - x == 0 && (r > 0 || l > 0)) ||
        (y1 - y == 0 && y2 - y == 0 && (u > 0 || d > 0))) {
      cout << "No\n";
      continue;
    }
    if (y1 - y <= u - d && u - d <= y2 - y && x1 - x <= r - l &&
        r - l <= x2 - x) {
      cout << "Yes\n";
      continue;
    } else
      cout << "No\n";
  }
  return 0;
}
