#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
template <typename T>
void print(const vector<T> &v, bool add_one = false, int start = -1,
           int end = -1) {
  if (start < 0) start = 0;
  if (end < 0) end = int(v.size());
  for (int i = start; i < end; i++)
    cout << v[i] + (add_one ? 1 : 0) << (i < end - 1 ? ' ' : '\n');
}
void solve() {
  int first, second, C, D;
  cin >> first >> second >> C >> D;
  int X, Y, X1, Y1, X2, Y2;
  cin >> X >> Y >> X1 >> Y1 >> X2 >> Y2;
  int left = first - second;
  int down = C - D;
  if (X == X1 && X == X2) {
    if (first > 0 || second > 0) {
      cout << "No\n";
      return;
    }
  }
  if (Y == Y1 && Y == Y2) {
    if (C > 0 || D > 0) {
      cout << "No\n";
      return;
    }
  }
  if (left < 0) {
    left = -left;
    if (left > (X2 - X)) {
      cout << "No\n";
      return;
    }
  } else {
    if (left > (X - X1)) {
      cout << "No\n";
      return;
    }
  }
  if (down < 0) {
    down = -down;
    if (down > (Y2 - Y)) {
      cout << "No\n";
      return;
    }
  } else {
    if (down > (Y - Y1)) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
}
