#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, x, y, x1, x2, y1, y2;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    x += (b - a);
    y += (d - c);
    if (x1 == x2 && a + b != 0) {
      cout << "No" << endl;
      continue;
    }
    if (y1 == y2 && c + d != 0) {
      cout << "No" << endl;
      continue;
    }
    if (x1 <= x && x <= x2) {
    } else {
      cout << "No" << endl;
      continue;
    }
    if (y1 <= y && y <= y2) {
    } else {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}
