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