#include <bits/stdc++.h>
using namespace std;
void input(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cin >> a[i];
}
void print(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << a[i] << ' ';
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t, a, b, c, d, x, y, x1, y1, x2, y2;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 && (a || b)) {
      cout << "No\n";
      continue;
    }
    if (x + b - min(a, b) > x2 || x - a + min(a, b) < x1) {
      cout << "No\n";
      continue;
    }
    if (y1 == y2 && (c || d)) {
      cout << "No\n";
      continue;
    }
    if (y + d - min(c, d) > y2 || y - c + min(c, d) < y1) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
  }
  return 0;
}
