#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, d, x, y, x1, y1, x2, y2;
    cin >> a >> b >> c >> d >> x >> y >> x1 >> y1 >> x2 >> y2;
    bool res = true;
    if (x - x1 < a - b) res = false;
    if (x2 - x < b - a) res = false;
    if (y - y1 < c - d) res = false;
    if (y2 - y < d - c) res = false;
    if (a + b != 0 && x1 == x2) res = false;
    if (c + d != 0 && y1 == y2) res = false;
    if (res)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
