#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int u = b - a;
    int v = d - c;
    int x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 && (a != 0 || b != 0)) {
      cout << "No" << endl;
      continue;
    }
    if (y1 == y2 && (c != 0 || d != 0)) {
      cout << "No" << endl;
      continue;
    }
    x = x + u;
    y = y + v;
    if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
