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<long long, long long> point[5][100005];
pair<long long, long long> rebr[300005], pt[300005];
bool cmp(pair<long long, long long> A, pair<long long, long long> B) {
  return (A.second < B.second) || (A.second == B.second && A.first < B.first);
}
long long vecs(pair<long long, long long> A, pair<long long, long long> B) {
  return A.first * B.second - A.second * B.first;
}
long long len(pair<long long, long long> A) {
  return A.first * A.first + A.second * A.second;
}
bool acmp(pair<long long, long long> A, pair<long long, long long> B) {
  bool fl1 = (A.second > 0) || (A.second == 0 && A.first > 0);
  bool fl2 = (B.second > 0) || (B.second == 0 && B.first > 0);
  if (fl1 != fl2) return fl1;
  return vecs(A, B) > 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n1, n2, n3;
  cin >> n1;
  for (int i = 1; i <= n1; i++) {
    cin >> point[1][i].first >> point[1][i].second;
    point[1][i + n1] = point[1][i];
  }
  cin >> n2;
  for (int i = 1; i <= n2; i++) {
    cin >> point[2][i].first >> point[2][i].second;
    point[2][i + n2] = point[2][i];
  }
  cin >> n3;
  for (int i = 1; i <= n3; i++) {
    cin >> point[3][i].first >> point[3][i].second;
    point[3][i + n3] = point[3][i];
  }
  int pos1 = 1, pos2 = 1, pos3 = 1;
  for (int i = 1; i <= n1; i++)
    if (cmp(point[1][i], point[1][pos1])) pos1 = i;
  for (int i = 1; i <= n2; i++)
    if (cmp(point[2][i], point[2][pos2])) pos2 = i;
  for (int i = 1; i <= n3; i++)
    if (cmp(point[3][i], point[3][pos3])) pos3 = i;
  pair<long long, long long> S = make_pair(
      point[1][pos1].first + point[2][pos2].first + point[3][pos3].first,
      point[1][pos1].second + point[2][pos2].second + point[3][pos3].second);
  int sch = 0;
  for (int i = pos1; i < n1 + pos1; i++) {
    sch++;
    rebr[sch] = make_pair(point[1][i + 1].first - point[1][i].first,
                          point[1][i + 1].second - point[1][i].second);
  }
  for (int i = pos2; i < n2 + pos2; i++) {
    sch++;
    rebr[sch] = make_pair(point[2][i + 1].first - point[2][i].first,
                          point[2][i + 1].second - point[2][i].second);
  }
  for (int i = pos3; i < n3 + pos3; i++) {
    sch++;
    rebr[sch] = make_pair(point[3][i + 1].first - point[3][i].first,
                          point[3][i + 1].second - point[3][i].second);
  }
  sort(rebr + 1, rebr + sch + 1, acmp);
  pt[1] = S;
  long long last = pt[1].first;
  for (int i = 1; i <= sch; i++) {
    pt[i + 1] =
        make_pair(pt[i].first + rebr[i].first, pt[i].second + rebr[i].second);
    if (pt[i + 1].second == pt[1].second) last = max(last, pt[i + 1].first);
  }
  int quer;
  cin >> quer;
  for (int rep = 1; rep <= quer; rep++) {
    pair<long long, long long> A;
    cin >> A.first >> A.second;
    A.first *= 3, A.second *= 3;
    if (A.second < pt[1].second) {
      cout << "NO\n";
      continue;
    }
    if (A.second == pt[1].second) {
      if (pt[1].first <= A.first && A.first <= last) {
        cout << "YES\n";
        continue;
      } else {
        cout << "NO\n";
        continue;
      }
    }
    pair<long long, long long> M =
        make_pair(A.first - pt[1].first, A.second - pt[1].second);
    int lef = 1, rig = sch + 1;
    while (lef + 1 < rig) {
      int mid = (lef + rig) / 2;
      pair<long long, long long> T =
          make_pair(pt[mid].first - pt[1].first, pt[mid].second - pt[1].second);
      if (vecs(T, M) > 0)
        lef = mid;
      else
        rig = mid;
    }
    if (lef == 1) {
      pair<long long, long long> T =
          make_pair(pt[2].first - pt[1].first, pt[2].second - pt[1].second);
      if (vecs(T, M) == 0 && len(T) >= len(M))
        cout << "YES\n";
      else
        cout << "NO\n";
      continue;
    }
    if (rig == sch + 1) {
      cout << "NO\n";
      continue;
    }
    pair<long long, long long> P =
        make_pair(A.first - pt[lef].first, A.second - pt[lef].second);
    pair<long long, long long> Q = make_pair(pt[rig].first - pt[lef].first,
                                             pt[rig].second - pt[lef].second);
    if (vecs(Q, P) < 0)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}