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;
  Point() {}
  Point(int x, int y) : x(x), y(y) {}
  Point& operator+=(Point p) {
    x += p.x;
    y += p.y;
    return *this;
  }
  Point& operator-=(Point p) {
    x -= p.x;
    y -= p.y;
    return *this;
  }
  friend Point operator+(const Point& p, const Point& q) {
    Point r = p;
    r += q;
    return r;
  }
  friend Point operator-(const Point& p, const Point& q) {
    Point r = p;
    r -= q;
    return r;
  }
};
long long CrossProduct(const Point& p, const Point& q) {
  return p.x * q.y - p.y * q.x;
}
int GetQuadrant(const Point& p) {
  if (p.x > 0 && p.y >= 0) return 1;
  if (p.x <= 0 && p.y > 0) return 2;
  if (p.x < 0 && p.y <= 0) return 3;
  return 4;
}
bool LessAngle(const Point& p, const Point& q) {
  int q_p = GetQuadrant(p), q_q = GetQuadrant(q);
  if (q_p != q_q) return q_p < q_q;
  return CrossProduct(p, q) > 0;
}
struct Convex {
  int n;
  vector<Point> p;
  void Read() {
    scanf("%d", &n);
    p.resize(n + 1);
    int x, y;
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", &x, &y);
      p[i].x = x;
      p[i].y = y;
    }
    p[n] = p[0];
    Normalize();
  }
  void Normalize() {
    Point first;
    int k = -1;
    for (int i = 0; i < n; ++i) {
      Point v = p[i + 1] - p[i];
      if (i == 0 || LessAngle(v, first)) {
        first = v;
        k = i;
      }
    }
    rotate(p.begin(), p.begin() + k, p.begin() + n);
    p[n] = p[0];
  }
  void CleanDup() {
    vector<Point> d(n + 1);
    int tail = 1;
    d[0] = p[0], d[1] = p[1];
    Point prev = d[1] - d[0];
    for (int i = 2; i <= n; ++i) {
      Point v = p[i] - d[tail];
      if (CrossProduct(prev, v) == 0)
        d[tail] = p[i];
      else
        d[++tail] = p[i];
      prev = d[tail] - d[tail - 1];
    }
    d.resize(tail + 1);
    n = tail;
    p = d;
  }
  bool Contains(const Point& q) const {
    int low = 1, high = n - 1;
    Point v = q - p[0];
    if (v.x == 0 && v.y == 0) return true;
    while (low <= high) {
      int mid = (low + high) >> 1;
      if (LessAngle(p[mid] - p[0], v))
        low = mid + 1;
      else
        high = mid - 1;
    }
    if (high == 0 && !LessAngle(v, p[1] - p[0])) high = 1;
    if (high == n - 1) return !LessAngle(p[high] - p[0], v);
    return CrossProduct(p[high] - q, p[high + 1] - q) >= 0;
  }
  void Output() const {
    printf("%d\n", n);
    for (int i = 0; i < n; ++i) printf("(%lld, %lld) ", p[i].x, p[i].y);
    printf("\n");
  }
};
void Combine(const Convex& P, const Convex& Q, Convex& R) {
  R.n = P.n + Q.n;
  R.p.resize(R.n + 1);
  R.p[0] = Point(0, 0);
  Point minR = R.p[0];
  int iP = 0, iQ = 0, iR = 0;
  Point vP = P.p[1] - P.p[0], vQ = Q.p[1] - Q.p[0];
  Point minP(P.p[0].x, P.p[0].y);
  Point minQ(Q.p[0].x, Q.p[0].y);
  while (iP < P.n || iQ < Q.n) {
    bool moveP;
    if (iP == P.n)
      moveP = 0;
    else if (iQ == Q.n)
      moveP = 1;
    else
      moveP = LessAngle(vP, vQ);
    ++iR;
    if (moveP) {
      R.p[iR] = R.p[iR - 1] + vP;
      ++iP;
      minP.x = min(minP.x, P.p[iP].x);
      minP.y = min(minP.y, P.p[iP].y);
      vP = P.p[iP + 1] - P.p[iP];
    } else {
      R.p[iR] = R.p[iR - 1] + vQ;
      ++iQ;
      minQ.x = min(minQ.x, Q.p[iQ].x);
      minQ.y = min(minQ.y, Q.p[iQ].y);
      vQ = Q.p[iQ + 1] - Q.p[iQ];
    }
    minR.x = min(minR.x, R.p[iR].x);
    minR.y = min(minR.y, R.p[iR].y);
  }
  Point t = minP + minQ;
  for (int i = 0; i < R.n; ++i) {
    R.p[i] -= minR;
    R.p[i] += t;
  }
  R.p[R.n] = R.p[0];
  R.CleanDup();
}
Convex a;
void PreCom() {
  Convex b, c;
  a.Read();
  for (int i = 0; i < 2; ++i) {
    b.Read();
    Combine(a, b, c);
    a = c;
  }
}
void Solve() {
  Point p;
  int n;
  int x, y;
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d", &x, &y);
    p.x = x, p.y = y;
    p.x *= 3;
    p.y *= 3;
    if (a.Contains(p))
      printf("YES\n");
    else
      printf("NO\n");
  }
}
int main() {
  PreCom();
  Solve();
  return 0;
}