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;
long long cross(pair<int, int> a, pair<int, int> b) {
  return 1LL * a.first * b.second - 1LL * a.second * b.first;
}
struct CHT {
  vector<long double> M, B;
  void init() {
    M.clear();
    B.clear();
  }
  bool bad(int l1, int l2, int l3) {
    return (B[l3] - B[l1]) / (M[l1] - M[l3]) <=
           (B[l2] - B[l1]) / (M[l1] - M[l2]) + 1e-12;
  }
  void add(long double m, long double b) {
    M.push_back(m);
    B.push_back(b);
    while (M.size() >= 3 && bad(M.size() - 3, M.size() - 2, M.size() - 1)) {
      M.erase(M.end() - 2);
      B.erase(B.end() - 2);
    }
    if (M.size() == 2 && M[0] == M[1]) {
      M.erase(M.end() - 2);
      B.erase(B.end() - 2);
    }
  }
  long double query(long double x) {
    int s = 0, e = (int)M.size() - 2;
    int p = 0;
    while (s <= e) {
      int m = (s + e) >> 1;
      if ((B[m + 1] - B[m]) / (M[m] - M[m + 1]) <= x + 1e-12) {
        p = m + 1;
        s = m + 1;
      } else
        e = m - 1;
    }
    return M[p] * x + B[p];
  }
} Le, Ri;
int N, M;
pair<int, int> st;
vector<pair<int, int> > Sum, P, tmp, Q;
vector<pair<int, int> > mrg(vector<pair<int, int> > &a,
                            vector<pair<int, int> > &b) {
  vector<pair<int, int> > ret;
  int pos1 = 0, pos2 = 0;
  while (pos1 < a.size() && pos2 < b.size()) {
    if (cross(a[pos1], b[pos2]) <= 0)
      ret.push_back(b[pos2]), pos2++;
    else
      ret.push_back(a[pos1]), pos1++;
  }
  while (pos1 < a.size()) ret.push_back(a[pos1]), pos1++;
  while (pos2 < b.size()) ret.push_back(b[pos2]), pos2++;
  return ret;
}
long double Top, Bottom;
void process() {
  Q.push_back(st);
  for (int i = 0; i < (int)Sum.size(); i++) {
    pair<int, int> t = pair<int, int>(Q.back().first + Sum[i].first,
                                      Q.back().second + Sum[i].second);
    Q.push_back(t);
  }
  Le.init();
  Ri.init();
  for (int i = 0; i < (int)Q.size() - 1; i++) {
    int j = i + 1;
    pair<int, int> v =
        pair<int, int>(Q[j].first - Q[i].first, Q[j].second - Q[i].second);
    if (cross(pair<int, int>(1, 0), v) > 0) {
      long double m =
          (long double)(Q[j].first - Q[i].first) / (Q[j].second - Q[i].second);
      long double b = (long double)Q[i].first - m * Q[i].second;
      Ri.add(m, b);
    }
  }
  for (int i = (int)Q.size() - 1; i >= 1; i--) {
    int j = i - 1;
    pair<int, int> v =
        pair<int, int>(Q[j].first - Q[i].first, Q[j].second - Q[i].second);
    if (cross(pair<int, int>(1, 0), v) > 0) {
      long double m =
          (long double)(Q[j].first - Q[i].first) / (Q[j].second - Q[i].second);
      long double b = (long double)Q[i].first - m * Q[i].second;
      Le.add(-m, -b);
    }
  }
  Top = -1e9, Bottom = 1e9;
  for (int i = 0; i < Q.size(); i++) {
    Top = max(Top, (long double)Q[i].second);
    Bottom = min(Bottom, (long double)Q[i].second);
  }
}
bool In(pair<int, int> a) {
  return Bottom <= a.second + 1e-12 && a.second <= Top + 1e-12 &&
         -Le.query(a.second) <= a.first + 1e-12 &&
         a.first <= Ri.query(a.second) + 1e-12;
}
int main() {
  st = pair<int, int>(0, 0);
  for (int n = 0; n < 3; n++) {
    scanf("%d", &N);
    P.clear();
    P.resize(N);
    for (int i = 0; i < N; i++) {
      scanf("%d %d", &P[i].first, &P[i].second);
    }
    int p = 0;
    for (int i = 0; i < N; i++) {
      if (P[p].second > P[i].second ||
          (P[p].second == P[i].second && P[p].first > P[i].first))
        p = i;
    }
    st.first += P[p].first;
    st.second += P[p].second;
    tmp.clear();
    for (int i = p; i < N; i++) {
      int j = (i + 1) % N;
      tmp.push_back(
          pair<int, int>(P[j].first - P[i].first, P[j].second - P[i].second));
    }
    for (int i = 0; i < p; i++) {
      int j = (i + 1) % N;
      tmp.push_back(
          pair<int, int>(P[j].first - P[i].first, P[j].second - P[i].second));
    }
    Sum = mrg(Sum, tmp);
  }
  process();
  scanf("%d", &M);
  for (int i = 0; i < M; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    if (In(pair<int, int>(3 * x, 3 * y)))
      printf("YES\n");
    else
      printf("NO\n");
  }
}