#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    int x, y, x1, y1, x2, y2;
    scanf("%d%d%d%d%d%d", &x, &y, &x1, &y1, &x2, &y2);
    if (x < x1 || x > x2 || y < y1 || y > y2 ||
        (((a != 0 || b != 0) && (x == x1 && x == x2)) ||
         ((c != 0 || d != 0) && (y == y1 && y == y2)))) {
      printf("NO\n");
      continue;
    }
    int deltax = min(a, b);
    a -= deltax;
    b -= deltax;
    int deltay = min(c, d);
    c -= deltay;
    d -= deltay;
    if (x - a + b < x1 || x - a + b > x2 || y - c + d < y1 || y - c + d > y2)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
