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;
void DBcontinue() {}
template <typename T, typename... Args>
void DBcontinue(T head, Args... tail) {
  char *head_name = strtok(NULL, ", ");
  cerr << "," << string(head_name) << "=" << head;
  DBcontinue(tail...);
}
template <typename T, typename... Args>
void DBin(const char *names, T head, Args... tail) {
  char *names_buf = new char[strlen(names) + 1];
  strcpy(names_buf, names);
  char *head_name = strtok(names_buf, ", ");
  cerr << 31 << ": " << string(head_name) << "=" << head;
  DBcontinue(tail...);
  cerr << "\n";
  delete[] names_buf;
}
template <class Container>
void print_cont(const Container &cont) {
  cerr << "{ ";
  for (auto it = begin(cont); it != end(cont); ++it) {
    if (it != begin(cont)) cerr << ", ";
    cerr << *it;
  }
  cerr << " }\n";
}
struct v2ll {
  long long x, y;
  v2ll operator+(const v2ll &v) const { return {x + v.x, y + v.y}; }
  v2ll operator-(const v2ll &v) const { return {x - v.x, y - v.y}; }
  v2ll operator*(const long long &t) const { return {t * x, t * y}; }
  long long operator*(const v2ll &v) const { return x * v.x + y * v.y; }
  long long operator^(const v2ll &v) const { return x * v.y - y * v.x; }
  bool operator==(const v2ll &v) const { return x == v.x && y == v.y; }
  void scan() {
    scanf("%I64d", &x);
    scanf("%I64d", &y);
  }
  friend istream &operator>>(istream &in, v2ll &v);
  friend ostream &operator<<(ostream &out, const v2ll &v);
};
istream &operator>>(istream &in, v2ll &v) {
  in >> v.x >> v.y;
  return in;
}
ostream &operator<<(ostream &out, const v2ll &v) {
  out << (v.x) << " " << (v.y);
  return out;
}
vector<v2ll> minkowski_sum(const vector<v2ll> &A, const vector<v2ll> &B) {
  int nA = A.size(), nB = B.size(), i, ni, j, nj;
  auto cmp_coords = [](const v2ll &a, const v2ll &b) {
    return (a.x < b.x || a.x == b.x && a.y < b.y);
  };
  i = min_element(A.begin(), A.end(), cmp_coords) - A.begin();
  ni = (i + 1) % nA;
  j = min_element(B.begin(), B.end(), cmp_coords) - B.begin();
  nj = (j + 1) % nB;
  vector<v2ll> ret;
  do {
    ret.push_back(A[i] + B[j]);
    long long cr = ((A[ni] - A[i]) ^ (B[nj] - B[j]));
    if (cr > 0)
      i = ni, ni = (i + 1) % nA;
    else if (cr < 0)
      j = nj, nj = (j + 1) % nB;
    else {
      i = ni, ni = (i + 1) % nA;
      j = nj, nj = (j + 1) % nB;
    }
  } while (!(A[i] + B[j] == ret[0]));
  return ret;
}
bool in_convex_polygon(const v2ll &P, const vector<v2ll> &A) {
  int n = A.size();
  if (P == A[0]) return true;
  if (((A[0] - A[n - 1]) ^ (P - A[0])) < 0 || ((A[1] - A[0]) ^ (P - A[0])) < 0)
    return false;
  int i = lower_bound(A.begin() + 1, A.end(), P,
                      [&](const v2ll &a, const v2ll &b) {
                        return ((a - A[0]) ^ (b - A[0])) > 0;
                      }) -
          A.begin();
  static_cast<void>(0);
  if (((P - A[0]) ^ (A[i] - A[0])) == 0) return ((A[0] - P) * (A[i] - P)) <= 0;
  return ((A[i] - A[i - 1]) ^ (P - A[i])) >= 0;
}
void run() {
  vector<v2ll> A[3], S;
  v2ll P;
  for (int ip = 0; ip < 3; ++ip) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
      P.scan();
      A[ip].push_back(P);
    }
  }
  S = minkowski_sum(A[0], A[1]);
  static_cast<void>(0);
  S = minkowski_sum(S, A[2]);
  static_cast<void>(0);
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) {
    P.scan();
    P = P * 3;
    puts(in_convex_polygon(P, S) ? "YES" : "NO");
  }
}
int main() {
  run();
  return 0;
}