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 (long long)a.first * b.second - (long long)a.second * b.first;
}
long long ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  pair<int, int> p = pair<int, int>(b.first - a.first, b.second - a.second);
  pair<int, int> q = pair<int, int>(c.first - a.first, c.second - a.second);
  return cross(p, q);
}
struct CHT {
  vector<long double> M, B;
  void init() {
    M.clear();
    B.clear();
  }
  bool bad(int l1, int l2, int l3) {
    return (M[l1] - M[l2]) * (B[l3] - B[l1]) <=
           (M[l1] - M[l3]) * (B[l2] - B[l1]);
  }
  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 idx = 0;
    while (s <= e) {
      int m = (s + e) >> 1;
      if ((M[m] - M[m + 1]) * x >= (B[m + 1] - B[m])) {
        idx = m + 1;
        s = m + 1;
      } else
        e = m - 1;
    }
    return M[idx] * x + B[idx];
  }
} le, ri;
int N[3];
vector<pair<int, int> > P[3];
vector<pair<int, int> > mcsk;
int bo, to;
void getMcskSum() {
  mcsk = P[0];
  for (int i = 1; i <= 2; i++) {
    vector<pair<int, int> > tmp = mcsk;
    mcsk.clear();
    mcsk.push_back(pair<int, int>(tmp[0].first + P[i][0].first,
                                  tmp[0].second + P[i][0].second));
    int pos1 = 0, pos2 = 0;
    while (pos1 < tmp.size() && pos2 < P[i].size()) {
      int npos1 = (pos1 + 1) % tmp.size();
      int npos2 = (pos2 + 1) % P[i].size();
      pair<int, int> vec1 =
          pair<int, int>(tmp[npos1].first - tmp[pos1].first,
                         tmp[npos1].second - tmp[pos1].second);
      pair<int, int> vec2 =
          pair<int, int>(P[i][npos2].first - P[i][pos2].first,
                         P[i][npos2].second - P[i][pos2].second);
      if (ccw(pair<int, int>(0, 0), vec1, vec2) <= 0) {
        pair<int, int> nV = pair<int, int>(mcsk.back().first + vec2.first,
                                           mcsk.back().second + vec2.second);
        mcsk.push_back(nV);
        pos2++;
      } else {
        pair<int, int> nV = pair<int, int>(mcsk.back().first + vec1.first,
                                           mcsk.back().second + vec1.second);
        mcsk.push_back(nV);
        pos1++;
      }
    }
    while (pos1 < tmp.size()) {
      int npos1 = (pos1 + 1) % tmp.size();
      pair<int, int> vec1 =
          pair<int, int>(tmp[npos1].first - tmp[pos1].first,
                         tmp[npos1].second - tmp[pos1].second);
      pair<int, int> nV = pair<int, int>(mcsk.back().first + vec1.first,
                                         mcsk.back().second + vec1.second);
      mcsk.push_back(nV);
      pos1++;
    }
    while (pos2 < P[i].size()) {
      int npos2 = (pos2 + 1) % P[i].size();
      pair<int, int> vec2 =
          pair<int, int>(P[i][npos2].first - P[i][pos2].first,
                         P[i][npos2].second - P[i][pos2].second);
      pair<int, int> nV = pair<int, int>(mcsk.back().first + vec2.first,
                                         mcsk.back().second + vec2.second);
      mcsk.push_back(nV);
      pos2++;
    }
  }
  bo = 1e9;
  to = -1e9;
  for (int i = 0; i < mcsk.size(); i++) {
    bo = min(bo, mcsk[i].second);
    to = max(to, mcsk[i].second);
  }
}
void getCHT() {
  le.init();
  ri.init();
  for (int i = 0; i < mcsk.size(); i++) {
    int j = (i + 1) % mcsk.size();
    pair<int, int> vec = pair<int, int>(mcsk[j].first - mcsk[i].first,
                                        mcsk[j].second - mcsk[i].second);
    if (vec.second == 0) continue;
    if (vec.second < 0) break;
    long double m = (long double)vec.first / vec.second;
    long double b = (long double)mcsk[i].first - m * mcsk[i].second;
    ri.add(m, b);
  }
  for (int i = mcsk.size(); i--;) {
    int j = (i + 1) % mcsk.size();
    pair<int, int> vec = pair<int, int>(mcsk[i].first - mcsk[j].first,
                                        mcsk[i].second - mcsk[j].second);
    if (vec.second == 0) continue;
    if (vec.second < 0) break;
    long double m = (long double)vec.first / vec.second;
    long double b = (long double)mcsk[j].first - m * mcsk[j].second;
    le.add(-m, -b);
  }
}
bool in(pair<int, int> p) {
  if (p.second < bo || to < p.second) return false;
  long double lx = -le.query(p.second);
  long double rx = ri.query(p.second);
  return lx - 1e-12 <= p.first && p.first <= rx + 1e-12;
}
int main() {
  for (int i = 0; i < 3; i++) {
    scanf("%d", &N[i]);
    P[i].resize(N[i]);
    pair<int, int> low = pair<int, int>(1e9, 1e9);
    int lpos;
    for (int j = 0; j < N[i]; j++) {
      scanf("%d %d", &P[i][j].first, &P[i][j].second);
      if (low.second > P[i][j].second ||
          (low.second == P[i][j].second && low.first > P[i][j].first)) {
        low = P[i][j];
        lpos = j;
      }
    }
    vector<pair<int, int> > tmp;
    for (int j = lpos; j < N[i]; j++) tmp.push_back(P[i][j]);
    for (int j = 0; j < lpos; j++) tmp.push_back(P[i][j]);
    P[i] = tmp;
  }
  getMcskSum();
  getCHT();
  int M;
  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");
  }
}