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