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 long double P = 0;
const int N = 400005;
inline int IN() {
  char ch = getchar();
  int f = 1, x = 0;
  while (((ch) == '\n' || (ch) == '\r' || (ch) == '\t' || (ch) == ' '))
    ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (!((ch) == '\n' || (ch) == '\r' || (ch) == '\t' || (ch) == ' '))
    x = x * 10 + ch - '0', ch = getchar();
  return x *= f;
}
struct po {
  long double x, y;
  void read() {
    double x0, y0;
    scanf("%lf%lf", &x0, &y0);
    x = x0 * cos(P) - y0 * sin(P);
    y = x0 * sin(P) + y0 * cos(P);
  }
  bool operator<(const po &a) const {
    return (x == a.x) ? (y < a.y) : (x < a.x);
  }
  long double operator*(const po &a) const { return x * a.y - y * a.x; }
  po operator+(const po &a) const { return (po){x + a.x, y + a.y}; }
  po operator-(const po &a) const { return (po){x - a.x, y - a.y}; }
  long double R() { return x * x + y * y; }
  bool operator==(const po &a) { return x == a.x && y == a.y; }
} a[N], b[N], c[N];
int n, m, p;
inline int cmp(const po &u, const po &v) {
  long double tmp = (u - a[1]) * (v - a[1]);
  if (tmp != 0) return tmp > 0;
  return (u - a[1]).R() < (v - a[1]).R();
}
void merge(po *a, po *b) {
  int A, B;
  A = 1;
  for (int i = (int)2; i <= (int)n; i++)
    if (a[i] < a[A]) A = i;
  B = 1;
  for (int i = (int)2; i <= (int)m; i++)
    if (b[i] < b[B]) B = i;
  c[p = 1] = a[A] + b[B];
  for (; !(p > 1 && c[p] == c[1]);) {
    po kA = a[A % n + 1] + b[B];
    po kB = b[B % m + 1] + a[A];
    if ((kA - c[p]) * (kB - c[p]) > 0) {
      c[++p] = kA;
      A = A % n + 1;
    } else {
      c[++p] = kB;
      B = B % m + 1;
    }
  }
  --p;
  for (int i = (int)1; i <= (int)p; i++) a[i] = c[i];
  n = p;
}
bool In(po A) {
  A = A - a[1];
  if ((A * a[2] > 0) || (A * a[2] == 0 && A.R() > a[2].R())) return 0;
  if ((A * a[n] < 0) || (A * a[n] == 0 && A.R() > a[n].R())) return 0;
  int l = 2, r = n;
  while (l + 1 < r) {
    int md = (l + r) >> 1;
    long double k = A * a[md];
    if (k == 0) {
      if (A.R() > a[md].R()) return 0;
      return 1;
    }
    if (k > 0)
      r = md;
    else
      l = md;
  }
  if ((A * a[l] == 0) && (A.R() > a[l].R())) return 0;
  if ((A * a[r] == 0) && (A.R() > a[r].R())) return 0;
  if ((A - a[l]) * (a[r] - a[l]) > 0) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = (int)1; i <= (int)n; i++) a[i].read();
  scanf("%d", &m);
  for (int i = (int)1; i <= (int)m; i++) b[i].read();
  merge(a, b);
  scanf("%d", &m);
  for (int i = (int)1; i <= (int)m; i++) b[i].read();
  merge(a, b);
  int Q = IN();
  sort(a + 2, a + n + 1, cmp);
  int t = 1;
  for (int i = (int)2; i <= (int)n; i++) a[i] = a[i] - a[1];
  for (int i = (int)2; i <= (int)n; i++) {
    if ((i == n) || (a[i] * a[i + 1] != 0))
      a[++t] = a[i];
    else
      continue;
  }
  n = t;
  while (Q--) {
    po T;
    T.read();
    T.x *= 3;
    T.y *= 3;
    puts(In(T) ? "YES" : "NO");
  }
  return 0;
}