#include <bits/stdc++.h>
int main() {
  int a, b, c, d, x, y, x1, x2, y1, y2, l;
  scanf("%d", &l);
  while (l--) {
    scanf("%d %d %d %d %d %d %d %d %d %d", &a, &b, &c, &d, &x, &y, &x1, &y1,
          &x2, &y2);
    if ((x == x1 && x1 == x2 && a + b != 0) ||
        (y == y1 && y1 == y2 & c + d != 0))
      printf("No\n");
    else {
      if (x1 <= x - a + b && x - a + b <= x2 && y1 <= y - c + d &&
          y - c + d <= y2)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
}
