#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int l, r, d, u;
    cin >> l >> r >> d >> u;
    int x, y, xl, yd, xr, yu;
    cin >> x >> y >> xl >> yd >> xr >> yu;
    int ans = 1;
    if ((r - l) > xr - x || (l - r) > x - xl) ans = 0;
    if (u - d > yu - y || d - u > y - yd) ans = 0;
    if (xl == xr && (l + r) > 0) ans = 0;
    if (yu == yd && (d + u) > 0) ans = 0;
    if (ans == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
