#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int a, b, c, d, x, y, x1, x2, y1, y2, temp = 0, tempp = 0, Flag = 0;
    cin >> a >> b >> c >> d >> x >> y >> x1 >> y1 >> x2 >> y2;
    temp = x - a + b;
    tempp = y - c + d;
    if ((temp <= x2 && temp >= x1) && (tempp <= y2 && tempp >= y1) &&
        (x2 > x1 || a + b == 0) && (y2 > y1 || c + d == 0))
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
