#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, x, y, x_, y_, x2, y2;
void init() {
  scanf("%d %d %d %d %d %d %d %d %d %d", &a, &b, &c, &d, &x, &y, &x_, &y_, &x2,
        &y2);
}
bool check() {
  if (a == b && a != 0 && x == x_ && x == x2) return 0;
  if (c == d && c != 0 && y == y_ && y == y2) return 0;
  return 1;
}
void work() {
  int T;
  scanf("%d", &T);
  while (T--) {
    init();
    if (x < x_ || x > x2 || y < y_ || y > y2) {
      puts("Yes");
      continue;
    }
    x += b - a, y += d - c;
    if (x >= x_ && x <= x2 && y >= y_ && y <= y2 && check())
      puts("Yes");
    else
      puts("No");
  }
}
int main() {
  work();
  return 0;
}
