#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long a, b, c, d;
    scanf("%I64d%I64d%I64d%I64d", &a, &b, &c, &d);
    long long x, y, x1, y1, x2, y2;
    scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &x, &y, &x1, &y1, &x2, &y2);
    int f = 1;
    if (x - a + b < x1 || x - a + b > x2) f = 0;
    if (y - c + d < y1 || y + d - c > y2) f = 0;
    if (x1 == x2 && y1 == y2) f = 0;
    if (x1 == x2 && (a || b)) f = 0;
    if (y1 == y2 && (c || d)) f = 0;
    if (f)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
