#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, x, y, x1, x2, y1, y2, e, first, flag = 0;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if ((x1 == x2) && (a != 0 || b != 0))
      cout << "no";
    else {
      if ((y1 == y2) && (c != 0 || d != 0))
        cout << "no";
      else {
        if (b > a) {
          e = b - a;
          if ((x + e) > x2) flag = 1;
        } else {
          first = a - b;
          if ((x - first) < x1) flag = 1;
        }
        if (c > d) {
          e = c - d;
          if (y - e < y1) flag = 1;
        } else {
          e = d - c;
          if (y + e > y2) flag = 1;
        }
        if (flag == 1)
          cout << "no";
        else
          cout << "yes";
      }
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
