#include <bits/stdc++.h>
using namespace std;
int t;
int a, b, c, d;
int x, y, xx1, yy1, xx2, yy2;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    scanf("%d%d%d%d%d%d", &x, &y, &xx1, &yy1, &xx2, &yy2);
    int f1 = x - a + b;
    int f2 = y - c + d;
    if (f1 < xx1 || f1 > xx2 || f2 < yy1 || f2 > yy2) {
      printf("NO\n");
      continue;
    }
    if (a != 0 && a == b && xx1 == x && x == xx2) {
      printf("NO\n");
      continue;
    }
    if (c != 0 && c == d && yy1 == y && y == yy2) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
  }
}
