#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int tc;
  cin >> tc;
  while (tc--) {
    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;
    long long int t1 = min(a, b);
    long long int t2 = min(c, d);
    if (!(x >= x1 and x <= x2 and y >= y1 and y <= y2)) {
      cout << "No" << endl;
      continue;
    }
    x -= a;
    x += b;
    y -= c;
    y += d;
    if (abs(x1 - x2) == 0) {
      if (y2 != y1) {
        if (a == 0 and b == 0 and y >= y1 and y <= y2)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    } else if (abs(y1 - y2) == 0) {
      if (x1 != x2) {
        if (c == 0 and d == 0 and x >= x1 and x <= x2)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    } else if (x >= x1 and x <= x2 and y >= y1 and y <= y2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
