#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main(int32_t argc, char const *argv[]) {
  c_p_c();
  long long t;
  cin >> t;
  while (t--) {
    long long l, r, d, u;
    cin >> l >> r >> d >> u;
    long long x, y, xl, yd, xr, yu;
    cin >> x >> y >> xl >> yd >> xr >> yu;
    long long 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 (yd == yu && (u + d) > 0) {
      ans = 0;
    }
    if (ans == 1) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
  return 0;
}
