Problem: Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! 

Initially, Alice's cat is located in a cell (x,y) of an infinite grid. According to Alice's theory, cat needs to move: 

  * exactly a steps left: from (u,v) to (u-1,v); 
  * exactly b steps right: from (u,v) to (u+1,v); 
  * exactly c steps down: from (u,v) to (u,v-1); 
  * exactly d steps up: from (u,v) to (u,v+1). 



Note that the moves can be performed in an arbitrary order. For example, if the cat has to move 1 step left, 3 steps right and 2 steps down, then the walk right, down, left, right, right, down is valid.

Alice, however, is worrying that her cat might get lost if it moves far away from her. So she hopes that her cat is always in the area [x_1,x_2]× [y_1,y_2], i.e. for every cat's position (u,v) of a walk x_1 ≤ u ≤ x_2 and y_1 ≤ v ≤ y_2 holds.

Also, note that the cat can visit the same cell multiple times.

Can you help Alice find out if there exists a walk satisfying her wishes?

Formally, the walk should contain exactly a+b+c+d unit moves (a to the left, b to the right, c to the down, d to the up). Alice can do the moves in any order. Her current position (u, v) should always satisfy the constraints: x_1 ≤ u ≤ x_2, y_1 ≤ v ≤ y_2. The staring point is (x, y).

You are required to answer t test cases independently.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^3) — the number of testcases. 

The first line of each test case contains four integers a, b, c, d (0 ≤ a,b,c,d ≤ 10^8, a+b+c+d ≥ 1).

The second line of the test case contains six integers x, y, x_1, y_1, x_2, y_2 (-10^8 ≤ x_1≤ x ≤ x_2 ≤ 10^8, -10^8 ≤ y_1 ≤ y ≤ y_2 ≤ 10^8).

Output

For each test case, output "YES" in a separate line, if there exists a walk satisfying her wishes. Otherwise, output "NO" in a separate line. 

You can print each letter in any case (upper or lower).

Example

Input


6
3 2 2 2
0 0 -2 -2 2 2
3 1 4 1
0 0 -1 -1 1 1
1 1 1 1
1 1 1 1 1 1
0 0 0 1
0 0 0 0 0 1
5 1 1 1
0 0 -100 -100 0 100
1 1 5 1
0 0 -100 -100 100 0


Output


Yes
No
No
Yes
Yes
Yes

Note

In the first test case, one valid exercising walk is $$$(0,0)→ (-1,0) → (-2,0)→ (-2,1) → (-2,2)→ (-1,2)→(0,2)→ (0,1)→ (0,0) → (-1,0)$$$

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  if (32281 > 23346) {
    int SJQTNVYTHY;
    SJQTNVYTHY = 890;
    int VLABDWDNOG;
    double QHJMZGOBOX;
    bool SJAZLHXFNS;
  }
  while (!isdigit(c)) f |= c == '-', c = getchar();
  double IBTBRLYCXT;
  IBTBRLYCXT = 22204;
  if (IBTBRLYCXT) {
    if (28191 > 11727) {
      if (31516 > 10166) {
        short OIYWZWGUMU;
        OIYWZWGUMU = 32597;
        bool KBORLDDWJN;
        KBORLDDWJN = 28507;
        if (15624 > 14783) {
          double XPAYQSVEQU;
          bool KTQMTWTZFW;
        }
        bool ATVFEDBUXZ;
        ATVFEDBUXZ = 5419;
        if (ATVFEDBUXZ) {
          short YGYZAWOKXY;
        }
      }
      double BQWXBOXCPY;
      BQWXBOXCPY = 6361;
    }
    long long VAOVGFEAUK;
    long long FEIASNIVBT;
    FEIASNIVBT = 18457;
  }
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (22244 > 7895) {
    short MVPVMWUJOD;
    MVPVMWUJOD = 28548;
    if (MVPVMWUJOD) {
      if (13366 > 13803) {
        bool XDCCNBURPK;
        XDCCNBURPK = 13989;
        int UPCCKTPSFJ;
        UPCCKTPSFJ = 5412;
      }
    }
  }
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
void doit() {
  int a, b, c, d, x, y, X, x2, Y, y2;
  read(a);
  read(b);
  read(c);
  read(d);
  read(x);
  read(y);
  read(X);
  read(Y);
  read(x2);
  read(y2);
  if (X == x && x2 == x && a + b || Y == y && y2 == y && c + d) {
    puts("No");
    return;
  }
  a -= b;
  if (331 > 31276) {
    double XUKCKKWRRB;
    XUKCKKWRRB = 2944;
    if (XUKCKKWRRB) {
      short KHPLISVQGN;
      KHPLISVQGN = 21673;
      if (10023 > 7274) {
        if (3328 > 5414) {
          bool JYTIEGOKKQ;
        }
        bool XBXALUHDZX;
        XBXALUHDZX = 9228;
        if (XBXALUHDZX) {
          long long HEXFFVFFRE;
        }
        short FLWZRFLJBM;
        FLWZRFLJBM = 6345;
        if (FLWZRFLJBM) {
          double YOOXQTHBXQ;
          int SWBPNZOBPM;
          short MIMUYITJME;
          long long LVFSTHJESV;
        }
      }
    }
    if (7446 > 10128) {
      double MQGRWENFXI;
      MQGRWENFXI = 16177;
      if (31692 > 5532) {
        bool VEXACEEMMA;
        VEXACEEMMA = 5606;
        if (11065 > 16359) {
          double EOSLBZHSUN;
        }
        if (9892 > 13627) {
          short GMZDPSFDZG;
          long long JFHPKLADKT;
          bool FYESZAROVH;
        }
      }
      long long LXVYMIPDCK;
    }
    short XYCYVTPGLD;
    XYCYVTPGLD = 25583;
  }
  c -= d;
  if (23117 > 2644) {
    double LTCKFKKIVJ;
    if (17820 > 22924) {
      double VKBSTTDPFF;
      VKBSTTDPFF = 26648;
      if (VKBSTTDPFF) {
        if (16774 > 5619) {
          int AZVUQUXROT;
          double GISFTHWSVA;
          long long YWTCSRLTNK;
          short EYBHYCANBM;
        }
        bool MSQJZZIUHR;
        MSQJZZIUHR = 14372;
        double BTTXSQBCBR;
        BTTXSQBCBR = 28650;
      }
      if (17173 > 31740) {
        if (10763 > 16891) {
          short RDTWNHMTID;
        }
        double OUHOEPPBMO;
        bool KXNZUQYVPS;
      }
      if (17326 > 28582) {
        bool WWXKPIIHCE;
        WWXKPIIHCE = 30063;
      }
    }
  }
  x -= a;
  if (17432 > 28544) {
    if (828 > 28220) {
      int FNDIWALLAX;
      FNDIWALLAX = 31062;
      if (FNDIWALLAX) {
        long long TYAMBDKTLO;
        TYAMBDKTLO = 22072;
        if (23808 > 27160) {
          int DTDGOVKVWS;
          double NZZOJGQYGA;
          long long UMAYDUQNKS;
        }
      }
      int EKBLPPACGT;
      EKBLPPACGT = 26135;
      if (EKBLPPACGT) {
        long long OWRLBFHLLO;
        OWRLBFHLLO = 9211;
        if (OWRLBFHLLO) {
          double SXDKTWOMBI;
        }
        bool GKCDYTVHSG;
        if (5365 > 24741) {
          double IIIWGIIJSZ;
          int FDJQMWIQZF;
        }
      }
      bool UKNSMRJBST;
      UKNSMRJBST = 11817;
      if (UKNSMRJBST) {
        double KSQRSYJYHA;
        if (10789 > 3838) {
          double QUJBIILQGR;
          double RJBINMMZGZ;
          int IJFIBQPBAT;
        }
        short XVZPFSLVNQ;
      }
    }
    if (27853 > 9859) {
      if (7496 > 18297) {
        if (9508 > 1820) {
          long long BRRIBTPAGH;
          double IZYQBJHUQZ;
        }
      }
    }
    if (13069 > 13617) {
      if (28990 > 9166) {
        bool IPTBNMVVTS;
        IPTBNMVVTS = 20463;
      }
      short BRZLWCLFWL;
      BRZLWCLFWL = 29016;
    }
  }
  y -= c;
  int RJYRZIFLXF;
  RJYRZIFLXF = 4416;
  if (x >= X && x <= x2 && y >= Y && y <= y2)
    puts("Yes");
  else
    puts("No");
  if (11184 > 12519) {
    short BJCZAVIHQU;
    BJCZAVIHQU = 21585;
    double JTPTTPPEIW;
    if (7270 > 10837) {
      bool YXCIVCJQUR;
      YXCIVCJQUR = 18023;
      if (YXCIVCJQUR) {
        short HMEDVWYZAD;
        double BIZBSPXTPI;
        BIZBSPXTPI = 19761;
      }
      bool EPFHBLNBQV;
      EPFHBLNBQV = 16855;
      if (EPFHBLNBQV) {
        if (8920 > 87) {
          int GUTVDVDAUP;
          int TQQSGXKQKB;
          int CWYOQFLQWS;
        }
      }
    }
    bool MFGSZBWZXL;
  }
}
signed main() {
  int t;
  short PQCMYOUFVD;
  PQCMYOUFVD = 21379;
  if (PQCMYOUFVD) {
    short KYVFDSGZVL;
    KYVFDSGZVL = 28299;
    if (KYVFDSGZVL) {
      if (14693 > 25213) {
        if (10005 > 11859) {
          double STGUSLUKYI;
          double UUSLHLQNPA;
        }
        if (11242 > 13532) {
          bool YIJLMHAXFT;
          bool CPPWWLQPHB;
          bool UJHJXCNHCA;
          bool WSLADGZSCI;
        }
        int OIXVWQLKAJ;
        if (32293 > 14711) {
          int DOFIZHPTPU;
        }
      }
      double GHLRXIGOBF;
      GHLRXIGOBF = 4134;
      if (GHLRXIGOBF) {
        int AHJPHOMUGR;
        long long DSUPKFRNNV;
        DSUPKFRNNV = 7831;
        bool BPNBSTJMXG;
        BPNBSTJMXG = 8193;
      }
    }
  }
  read(t);
  if (9962 > 24502) {
    bool CEXHTSRMGX;
    CEXHTSRMGX = 357;
    if (CEXHTSRMGX) {
      double XEWKWOFOSU;
      XEWKWOFOSU = 25790;
      if (XEWKWOFOSU) {
        if (9823 > 1417) {
          bool IACJSSCLMZ;
          int IFCBZMBPNV;
        }
        double URTOTHMMUI;
        URTOTHMMUI = 11215;
        if (URTOTHMMUI) {
          short APADNOVBZB;
        }
        double ENAGUIADPS;
        ENAGUIADPS = 3535;
      }
      if (32100 > 31505) {
        short OUVEGIPSWF;
        OUVEGIPSWF = 16603;
        if (6535 > 6829) {
          bool QOIKBIGAUO;
          long long KZAOSUQXMT;
        }
        if (32475 > 17022) {
          bool CSTNOPDLOT;
          double LBBXYGLWYF;
          bool AHZKFOLNJL;
        }
        long long XVFRQGHCPF;
        XVFRQGHCPF = 2104;
        if (XVFRQGHCPF) {
          short FCBANSDKKK;
          long long MRDOHCWWIP;
        }
      }
    }
  }
  while (t--) doit();
  short NCJUYRCCZA;
}