#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17 + 9;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long x, y, x1, x2, y1, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    bool can = true;
    if (x == x1 && x == x2 && (a > 0 || b > 0)) {
      can = false;
    }
    if (y == y1 && y == y2 && (c > 0 || d > 0)) {
      can = false;
    }
    int dif = b - a;
    int dif2 = d - c;
    if (x + dif > x2) can = false;
    if (x + dif < x1) can = false;
    if (y + dif2 > y2) can = false;
    if (y + dif2 < y1) can = false;
    if (can)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
