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;
int sig(double x) { return (x > 1e-8) - (x < -1e-8); }
const double pi = acos(-1.0);
struct P {
  double x, y, ang;
  P(double a = 0, double b = 0) : x(a), y(b) {}
  P operator+(const P &a) const { return P(x + a.x, y + a.y); }
  P operator-(const P &a) const { return P(x - a.x, y - a.y); }
  P operator*(const double a) const { return P(x * a, y * a); }
  P operator/(const double a) const { return P(x / a, y / a); }
  double operator*(const P &a) const { return x * a.x + y * a.y; }
  double operator^(const P &a) const { return x * a.y - y * a.x; }
  bool operator==(const P &a) const {
    return sig(x - a.x) == 0 && sig(y - a.y) == 0;
  }
  bool on(P a, P b) {
    if (a == *this || b == *this) return 1;
    P v1 = a - *this, v2 = b - *this;
    return !sig(v1 ^ v2) && sig(v1 * v2) <= 0;
  }
};
double across(P a, P b, P c) { return (b - a) ^ (c - a); }
int cmp1(P a, P b) {
  if (sig(a.x - b.x) != 0)
    return a.x < b.x;
  else
    return a.y < b.y;
}
int Graham(P *p, int n, P *q) {
  sort(p, p + n, cmp1);
  int m = 0;
  for (int i = 0; i < n; i++) {
    while (m > 1 && sig((q[m - 1] - q[m - 2]) ^ (p[i] - q[m - 2])) <= 0) m--;
    q[m++] = p[i];
  }
  int k = m;
  for (int i = n - 2; i >= 0; i--) {
    while (m > k && sig((q[m - 1] - q[m - 2]) ^ (p[i] - q[m - 2])) <= 0) m--;
    q[m++] = p[i];
  }
  if (n > 1) m--;
  return m;
}
int inside(P a, P b, P c, P p) {
  double s = fabs(across(a, b, c));
  double sa = fabs(across(a, b, p));
  double sb = fabs(across(a, c, p));
  double sc = fabs(across(b, c, p));
  return (s == (sa + sb + sc));
}
bool inpoly(P a, P *p, int n) {
  if (across(p[0], p[1], a) < 0 || across(p[0], p[n - 1], a) > 0) return 0;
  int r = n - 1, l = 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (across(p[0], p[m], a) >= 0)
      l = m;
    else
      r = m;
  }
  return inside(p[0], p[l], p[r], a);
}
P p1[50010], p2[50010], p3[50010], p[150010], pp[150010], q[150010];
int cnt;
P input(int n, P *ch) {
  P a;
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &ch[i].x, &ch[i].y);
    if (i == 0)
      a = ch[i];
    else {
      if (a.y > ch[i].y)
        a = ch[i];
      else if (sig(a.y - ch[i].y) == 0) {
        if (ch[i].x < a.x) a = ch[i];
      }
    }
  }
  ch[n] = ch[0];
  for (int i = 1; i <= n; i++) {
    pp[cnt] = ch[i] - ch[i - 1];
    pp[cnt].ang = atan2(pp[cnt].y, pp[cnt].x);
    if (sig(pp[cnt].ang) < 0) pp[cnt].ang += 2 * pi;
    cnt++;
  }
  return a;
}
int cmp(P a, P b) { return a.ang < b.ang; }
int main() {
  int n, m;
  while (scanf("%d", &n) != EOF) {
    cnt = 0;
    P a = input(n, p1);
    scanf("%d", &n);
    a = a + input(n, p2);
    scanf("%d", &n);
    a = a + input(n, p3);
    p[0] = a;
    sort(pp, pp + cnt, cmp);
    for (int i = 1; i <= cnt; i++) {
      p[i] = p[i - 1] + pp[i - 1];
    }
    cnt = Graham(p, cnt, q);
    scanf("%d", &m);
    for (int i = 0; i < m; i++) {
      P b;
      scanf("%lf%lf", &b.x, &b.y);
      b = b * 3;
      if (inpoly(b, q, cnt) == 1)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}