#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
istream& operator>>(istream& in, vector<T>& a) {
  for (auto& i : a) in >> i;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T>& a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <typename T, typename U>
void chkmin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void chkmax(T& a, U b) {
  if (a < b) a = b;
}
void solve() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int x, y, x1, y1, x2, y2;
  cin >> x >> y >> x1 >> y1 >> x2 >> y2;
  if (x2 - x1 < 1 && (a || b)) {
    cout << "No\n";
    return;
  }
  if (y2 - y1 < 1 && (c || d)) {
    cout << "No\n";
    return;
  }
  if (x1 <= x + b - a && x + b - a <= x2 && y1 <= y + d - c && y + d - c <= y2)
    cout << "Yes";
  else
    cout << "No";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int t;
  cin >> t;
  while (t-- > 0) solve();
  return 0;
}
