#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    long long int x, y, x1, x2, y1, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    long long int x3 = x - x1, x4 = x2 - x;
    long long int y3 = y - y1, y4 = y2 - y;
    long long int netl = a - b;
    long long int netd = c - d;
    if (netl <= x3 && -netl <= x4 && netd <= y3 && -netd <= y4 &&
        (!(netl == 0 && a != 0) || x3 + x4 > 0) &&
        (!(netd == 0 && c != 0) || y3 + y4 > 0)) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
}
