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;
struct point {
  long long x, y;
};
int n[3], N;
point A[3][50010], B[150010];
int start[3], pos[3];
long long area(point &P, point &Q, point &R) {
  return (Q.x - P.x) * (R.y - P.y) - (Q.y - P.y) * (R.x - P.x);
}
long long inprod(point &O, point &P, point &Q) {
  return (P.x - O.x) * (Q.x - O.x) + (P.y - O.y) * (Q.y - O.y);
}
bool on(point &A, point &B, point &P) {
  if (area(A, B, P) != 0) return false;
  if (inprod(A, B, P) >= 0 && inprod(B, A, P) >= 0) return true;
  return false;
}
bool inside(point &A, point &B, point &C, point &P) {
  long long sa = ((area(P, B, C)) > 0 ? (area(P, B, C)) : -(area(P, B, C)));
  long long sb = ((area(P, C, A)) > 0 ? (area(P, C, A)) : -(area(P, C, A)));
  long long sc = ((area(P, A, B)) > 0 ? (area(P, A, B)) : -(area(P, A, B)));
  long long s = ((area(A, B, C)) > 0 ? (area(A, B, C)) : -(area(A, B, C)));
  if (sa != 0 && sb != 0 && sc != 0 && s == sa + sb + sc) return true;
  if (on(A, B, P) || on(B, C, P) || on(C, A, P)) return true;
  return false;
}
bool add(point P) {
  if (N >= 2 && area(B[N - 2], B[N - 1], P) == 0) N--;
  B[N] = P;
  N++;
}
void calc(void) {
  int i, j;
  for ((i) = 0; (i) < (int)(3); (i)++) {
    int tmp = 0;
    for ((j) = 0; (j) < (int)(n[i]); (j)++)
      if (A[i][j].x > A[i][tmp].x ||
          (A[i][j].x == A[i][tmp].x && A[i][j].y < A[i][tmp].y))
        tmp = j;
    start[i] = tmp;
  }
  while (pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]) {
    int p = (start[0] + pos[0]) % n[0], p2 = (start[0] + pos[0] + 1) % n[0];
    int q = (start[1] + pos[1]) % n[1], q2 = (start[1] + pos[1] + 1) % n[1];
    int r = (start[2] + pos[2]) % n[2], r2 = (start[2] + pos[2] + 1) % n[2];
    point P = {A[0][p].x + A[1][q].x + A[2][r].x,
               B[N].y = A[0][p].y + A[1][q].y + A[2][r].y};
    add(P);
    int next = -1;
    long long dx = 0, dy = 0;
    for ((i) = 0; (i) < (int)(3); (i)++)
      if (pos[i] < n[i]) {
        long long dx2 = 0, dy2 = 0;
        if (i == 0) {
          dx2 = A[0][p2].x - A[0][p].x;
          dy2 = A[0][p2].y - A[0][p].y;
        }
        if (i == 1) {
          dx2 = A[1][q2].x - A[1][q].x;
          dy2 = A[1][q2].y - A[1][q].y;
        }
        if (i == 2) {
          dx2 = A[2][r2].x - A[2][r].x;
          dy2 = A[2][r2].y - A[2][r].y;
        }
        int sign = ((dx < 0 || (dx == 0 && dy > 0)) ? 0 : 1);
        int sign2 = ((dx2 < 0 || (dx2 == 0 && dy2 > 0)) ? 0 : 1);
        bool good = false;
        if (next == -1) good = true;
        if (sign2 < sign) good = true;
        if (sign == sign2) {
          long long s = dx * dy2 - dx2 * dy;
          if (s < 0) good = true;
        }
        if (good) {
          next = i;
          dx = dx2;
          dy = dy2;
        }
      }
    pos[next]++;
  }
}
bool func(int x, int y) {
  int i;
  point P = {3ll * x, 3ll * y};
  if (area(B[0], B[1], P) < 0) return false;
  if (area(B[0], B[N - 1], P) > 0) return false;
  int low = 1, high = N - 1;
  while (high - low > 1) {
    int mid = (high + low) / 2;
    if (area(B[0], B[mid], P) >= 0)
      low = mid;
    else
      high = mid;
  }
  return inside(B[0], B[low], B[high], P);
}
int main(void) {
  int Q, i, j, x, y, tmp;
  for ((i) = 0; (i) < (int)(3); (i)++) {
    scanf("%d", &n[i]);
    for ((j) = 0; (j) < (int)(n[i]); (j)++) {
      scanf("%d", &tmp);
      A[i][j].x = tmp;
      scanf("%d", &tmp);
      A[i][j].y = tmp;
    }
  }
  calc();
  scanf("%d", &Q);
  for ((i) = 0; (i) < (int)(Q); (i)++) {
    scanf("%d%d", &x, &y);
    bool ans = func(x, y);
    if (ans)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}