#include <bits/stdc++.h>
int main() {
  int inputNum;
  std::cin >> inputNum;
  for (int i = 0; i < inputNum; i++) {
    int a, b, c, d, x, y, x1, y1, x2, y2;
    std::cin >> a >> b >> c >> d;
    std::cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    if (a | b && x1 == x2) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (c | d && y1 == y2) {
      std::cout << "No" << std::endl;
      continue;
    }
    int ival = b - a;
    if ((ival + x) < x1 || (ival + x) > x2) {
      std::cout << "No" << std::endl;
      continue;
    }
    ival = d - c;
    if ((ival + y) < y1 || (ival + y) > y2) {
      std::cout << "No" << std::endl;
      continue;
    }
    std::cout << "Yes" << std::endl;
  }
  return 0;
}
