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;
pair<int, int> operator+(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first + b.first, a.second + b.second);
}
pair<int, int> operator-(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first - b.first, a.second - b.second);
}
long long productVect(const pair<int, int>& a, const pair<int, int>& b) {
  long long A = a.first;
  long long B = a.second;
  long long C = b.first;
  long long D = b.second;
  return A * D - B * C;
}
bool pii_comp_x(const pair<int, int>& a, const pair<int, int>& b) {
  return a.first < b.first;
}
int inChain(const vector<pair<int, int> >& up,
            const vector<pair<int, int> >& dn, const pair<int, int>& pnt) {
  if (pnt.first < up[0].first) return 0;
  if (pnt.first > up.back().first) return 0;
  int i = lower_bound(up.begin(), up.end(), pnt, pii_comp_x) - up.begin();
  int j = lower_bound(dn.begin(), dn.end(), pnt, pii_comp_x) - dn.begin();
  int u = up.size();
  int d = dn.size();
  if (i > 0) i--;
  if (j > 0) j--;
  if (productVect(up[i + 1] - up[i], pnt - up[i]) > 0) return 0;
  if (productVect(dn[j + 1] - dn[j], pnt - dn[j]) < 0) return 0;
  return 1;
}
void convex_minko_sum(const vector<pair<int, int> >& a,
                      const vector<pair<int, int> >& b,
                      vector<pair<int, int> >& out) {
  out.clear();
  int i = 0, j = 0;
  for (int q = 0; q < a.size(); ++q)
    if (a[q] < a[i]) i = q;
  for (int q = 0; q < b.size(); ++q)
    if (b[q] < b[j]) j = q;
  do {
    out.push_back(a[i] + b[j]);
    long long pro =
        productVect(a[(i + 1) % a.size()] - a[i], b[(j + 1) % b.size()] - b[j]);
    if (pro >= 0) i = (i + 1) % a.size();
    if (pro <= 0) j = (j + 1) % b.size();
  } while (a[i] + b[j] != out[0]);
}
int main() {
  vector<pair<int, int> > T[5];
  for (int q = 0; q < 3; ++q) {
    int sz;
    scanf("%d", &sz);
    for (int w = 0; w < sz; ++w) {
      pair<int, int> u;
      scanf("%d %d", &u.first, &u.second);
      T[q].push_back(u);
    }
  }
  convex_minko_sum(T[0], T[1], T[3]);
  convex_minko_sum(T[2], T[3], T[4]);
  vector<pair<int, int> > up, down;
  for (int q = 0; q < T[4].size(); ++q) {
    pair<int, int> a = T[4][q];
    pair<int, int> b = T[4][(q + 1) % T[4].size()];
    if (a.first < b.first) {
      if (down.empty() || down.back() != a) down.push_back(a);
      down.push_back(b);
    }
    if (a.first > b.first) {
      if (up.empty() || up.back() != a) up.push_back(a);
      up.push_back(b);
    }
  }
  reverse(up.begin(), up.end());
  int Quest;
  scanf("%d", &Quest);
  for (int q = 0; q < Quest; ++q) {
    pair<int, int> u;
    scanf("%d %d", &u.first, &u.second);
    u.first *= 3;
    u.second *= 3;
    printf("%s\n", inChain(up, down, u) ? "YES" : "NO");
  }
  return 0;
}