#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  int x = 0;
  bool op = 0;
  while (!isdigit(c)) op |= (c == '-'), c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return op ? -x : x;
}
int t;
int main() {
  t = read();
  while (t--) {
    int a = read(), b = read(), c = read(), d = read();
    int movex = b - a, movey = d - c;
    int x = read(), y = read(), tx1 = read(), ty1 = read(), tx2 = read(),
        ty2 = read();
    int ex = x + movex, ey = y + movey;
    if ((tx1 == tx2 && (a != 0 || b != 0)) ||
        (ty1 == ty2 && (c != 0 || d != 0)))
      printf("NO\n");
    else if ((ex >= tx1 && ex <= tx2 && ey >= ty1 && ey <= ty2))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
