#include <bits/stdc++.h>
using namespace std;
bool inRange(int x, int l, int r) { return l <= x && x <= r; }
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    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 == x2 ? b == 0 && a == 0 : inRange(x + b - a, x1, x2)) &&
        (y1 == y2 ? d == 0 && c == 0 : inRange(y + d - c, y1, y2))) {
      cout << "Yes";
    } else {
      cout << "No";
    }
    cout << endl;
  }
  return 0;
}
