#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d;
    int x, y, x1, y1, x2, y2;
    cin >> a >> b >> c >> d;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
    int t = abs(a - b), v = abs(d - c);
    int flag = 1;
    if (b > a && x2 - x < t) flag = 0;
    if (a > b && x - x1 < t) flag = 0;
    if (c > d && y - y1 < v) flag = 0;
    if (d > c && y2 - y < v) flag = 0;
    if ((c > 0 || d > 0) && (y1 == y) && (y2 == y)) flag = 0;
    if ((a > 0 || b > 0) && (x1 == x) && (x2 == x)) flag = 0;
    if (t > max(abs(x - x1), abs(x - x2)) || v > max(abs(y - y1), abs(y - y2)))
      flag = 0;
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
