Problem: A long time ago somewhere in the depths of America existed a powerful tribe governed by the great leader Pinnie-the-Wooh. Once the tribe conquered three Maya cities. Pinnie-the-Wooh grew concerned: there had to be some control over the conquered territories. That's why he appealed to the priests of the supreme god Mogohu-Rea for help.

The priests conveyed the god's will to him: to control these three cities he should put an idol to Mogohu-Rea — that will create a religious field over the cities. However, the idol is so powerful that it can easily drive the people around it mad unless it is balanced by exactly three sacrifice altars, placed one in each city. To balance the idol the altars should be placed so that the center of mass of the system of these three points coincided with the idol. When counting the center of mass consider that all the altars have the same mass.

Now Pinnie-the-Wooh is thinking where to put the idol. He has a list of hills, that are suitable to put an idol there. Help him to identify on which of them you can put an idol without risking to fry off the brains of the cities' population with the religious field.

Each city has a shape of a convex polygon such that no three vertexes lie on a straight line. The cities can intersect. Each altar should be attached to the city through a special ceremony, besides, it must be situated on the city's territory (possibly at the border). Thus, there may be several altars on a city's territory, but exactly one of them will be attached to the city. The altars, the idol and the hills are points on the plane, some of them may coincide.

The hills are taken into consideration independently from each other, the altars' location for different hills may also be different.

Input

First follow descriptions of the three cities, divided by empty lines. The descriptions are in the following format:

The first line contains an integer n, which represent the number of the polygon's vertexes (3 ≤ n ≤ 5·104). Next n lines contain two integers xi, yi each, they are the coordinates of the polygon's i-th vertex in the counterclockwise order.

After the cities' description follows the integer m (1 ≤ m ≤ 105), which represents the number of hills. Next m lines each contain two integers xj, yj, they are the coordinates of the j-th hill.

All the coordinates in the input data do not exceed 5·108 in the absolute value.

Output

For each hill print on a single line "YES" (without the quotes) or "NO" (without the quotes), depending on whether the three sacrifice altars can be put to balance the idol or not.

Examples

Input

3
0 0
1 0
1 1

4
8 8
5 5
6 4
8 4

3
-1 -1
-3 -1
-2 -2

5
0 0
2 1
7 1
1 1
5 3


Output

NO
YES
NO
YES
NO

Note

For the hill at (2, 1) the altars can be placed at the points (1, 0), (7, 5), ( - 2, - 2), for the hill at (1, 1) — at the points (0, 0), (6, 4), ( - 3, - 1). Many other groups of three points can do the trick. There are no suitable points for other hills.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int oo = ~0u >> 2, mo = (int)1e9 + 7;
const int mn = 300000;
struct po {
  int x, y;
  po() { x = y = 0; }
  po(int _x, int _y) { x = _x, y = _y; }
  void readin() { scanf("%d%d", &x, &y); }
  bool operator<(const po &p) { return x < p.x || (x == p.x && y < p.y); }
  po operator+(const po &p) { return po(x + p.x, y + p.y); }
  po operator-(const po &p) { return po(x - p.x, y - p.y); }
  po operator*(int d) { return po(x * d, y * d); }
};
long long det(po a, po b, po c) {
  return (long long)(b.x - a.x) * (c.y - a.y) -
         (long long)(c.x - a.x) * (b.y - a.y);
}
long long dis(po a, po b) {
  return ((long long)(a.x - b.x) * (a.x - b.x)) +
         ((long long)(a.y - b.y) * (a.y - b.y));
}
po plb;
bool cmp(const po &a, const po &b) {
  long long t = det(plb, a, b);
  return t > 0 || (!t && dis(plb, a) > dis(plb, b));
}
struct CH {
  po P[mn];
  int n;
  void ins(po p) { P[n++] = p; }
  void readin() {
    scanf("%d", &n);
    for (int i = 0; i <= n - 1; ++i) P[i].readin();
  }
  bool Contain(po o) {
    long long t = det(P[0], P[1], o);
    if (t < 0 || (!t && dis(P[0], o) > dis(P[0], P[1]))) return 0;
    t = det(P[0], P[n - 1], o);
    if (t > 0 || (!t && dis(P[0], o) > dis(P[0], P[n - 1]))) return 0;
    int l = 1, r = n - 2, w = 0;
    while (l <= r) {
      int m = (l + r) / 2;
      po p = P[m];
      long long t = det(P[0], P[m], o);
      if (t >= 0)
        w = m, l = m + 1;
      else
        r = m - 1;
    }
    l = w, r = (l + 1) % n;
    po p1 = P[l], p2 = P[r];
    t = det(p1, p2, o);
    return t >= 0;
  }
  void ConvexHull() {
    for (int i = 1; i <= n - 1; ++i)
      if (P[i] < P[0]) swap(P[0], P[i]);
    plb = P[0];
    sort(P + 1, P + n, cmp);
    int r = 1;
    for (int i = 2; i <= n - 1; ++i)
      if (det(P[0], P[r], P[i])) {
        while (r && det(P[r - 1], P[r], P[i]) <= 0) --r;
        P[++r] = P[i];
      }
    n = r + 1;
  }
} Q[5];
void mrg(CH &A, CH &B, CH &C) {
  C.n = 0;
  int l = 0, r = 0;
  do {
    int nl = (l + 1) % A.n, nr = (r + 1) % B.n;
    po O = A.P[l] + B.P[r], P1 = A.P[l] + B.P[nr], P2 = A.P[nl] + B.P[r];
    long long t = det(O, P1, P2);
    if (t > 0 || (!t && dis(O, P1) > dis(O, P2)))
      C.ins(P1), r = nr;
    else
      C.ins(P2), l = nl;
  } while (l || r);
  C.ConvexHull();
}
int main() {
  for (int i = 0; i <= 2; ++i) Q[i].readin(), Q[i].ConvexHull();
  mrg(Q[0], Q[1], Q[3]);
  mrg(Q[2], Q[3], Q[4]);
  int Ca;
  scanf("%d", &Ca);
  while (Ca--) {
    po p;
    p.readin();
    p = p * 3;
    bool flag = Q[4].Contain(p);
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
}