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;
vector<pair<long long, long long> > con[3];
vector<pair<long long, long long> > sum;
int main() {
  for (long long i = 0; i < ((long long)3); i++) {
    long long n;
    cin >> n;
    for (long long j = 0; j < ((long long)n); j++) {
      long long x, y;
      cin >> x >> y;
      con[i].push_back(make_pair(x, y));
    }
  }
  long long pos[3] = {1, 1, 1};
  long long start[3] = {1, 1, 1};
  for (long long i = 0; i < ((long long)3); i++)
    for (long long j = 0; j < ((long long)((long long)con[i].size())); j++)
      if (con[i][start[i]] < con[i][j]) pos[i] = start[i] = j;
  long long sum_x = 0;
  long long sum_y = 0;
  bool f[3] = {true, true, true};
  while (pos[0] != start[0] || pos[1] != start[1] || pos[2] != start[2] ||
         f[0] || f[1] || f[2]) {
    double ang[3] = {0, 0, 0};
    long long next[3] = {(pos[0] + 1) % ((long long)con[0].size()),
                         (pos[1] + 1) % ((long long)con[1].size()),
                         (pos[2] + 1) % ((long long)con[2].size())};
    for (long long i = 0; i < ((long long)3); i++) {
      double xx = (con[i][next[i]].first) - (con[i][pos[i]].first);
      double yy = (con[i][next[i]].second) - (con[i][pos[i]].second);
      ang[i] = (yy == 0) ? (acos(-1) / 2.0) : acos(yy / hypot(xx, yy));
      if (0 < xx) ang[i] = acos(-1) * 2.0 - ang[i];
      if (ang[i] == 0) ang[i] = acos(-1) * 2.0;
      if (pos[i] == start[i] && !f[i]) ang[i] = 365;
    }
    long long mini = 0;
    for (long long i = 0; i < ((long long)3); i++)
      if (ang[i] < ang[mini]) mini = i;
    pos[mini] = next[mini];
    f[mini] = false;
    sum_x = sum_y = 0;
    for (long long i = 0; i < ((long long)3); i++)
      sum_x += (con[i][pos[i]].first);
    for (long long i = 0; i < ((long long)3); i++)
      sum_y += (con[i][pos[i]].second);
    sum.push_back(make_pair(sum_x, sum_y));
  }
  vector<pair<long long, long long> > low, high;
  long long mini = 0, maxi = 0;
  long long mini_y[2], maxi_y[2];
  for (long long i = 0; i < ((long long)((long long)sum.size())); i++)
    if (sum[i] < sum[mini]) mini = i;
  for (long long i = 0; i < ((long long)((long long)sum.size())); i++)
    if (sum[maxi] < sum[i]) maxi = i;
  for (int i = mini; i != maxi; i = (i + 1) % ((long long)sum.size()))
    low.push_back(sum[i]);
  for (int i = mini; i != maxi;
       i = (i + ((long long)sum.size()) - 1) % ((long long)sum.size()))
    high.push_back(sum[i]);
  low.push_back(sum[maxi]);
  high.push_back(sum[maxi]);
  for (long long i = 0; i < ((long long)2); i++) mini_y[i] = sum[mini].second;
  for (long long i = 0; i < ((long long)2); i++) maxi_y[i] = sum[maxi].second;
  for (long long i = 0; i < ((long long)((long long)sum.size())); i++)
    if (sum[i].first == sum[mini].first) {
      mini_y[0] = min(mini_y[0], sum[i].second);
      mini_y[1] = max(mini_y[1], sum[i].second);
    }
  for (long long i = 0; i < ((long long)((long long)sum.size())); i++)
    if (sum[i].first == sum[maxi].first) {
      maxi_y[0] = min(maxi_y[0], sum[i].second);
      maxi_y[1] = max(maxi_y[1], sum[i].second);
    }
  sort(low.begin(), low.end());
  sort(high.begin(), high.end());
  long long n;
  cin >> n;
  for (long long i = 0; i < ((long long)n); i++) {
    long long xx, yy;
    cin >> xx >> yy;
    xx *= 3;
    yy *= 3;
    if (xx == sum[maxi].first) {
      if (maxi_y[0] <= yy && yy <= maxi_y[1])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else if (xx == sum[mini].first) {
      if (mini_y[0] <= yy && yy <= mini_y[1])
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else if (sum[mini].first < xx && xx < sum[maxi].first) {
      vector<pair<long long, long long> >::iterator lp0 =
          upper_bound(low.begin(), low.end(), make_pair(xx, yy));
      vector<pair<long long, long long> >::iterator hp0 =
          upper_bound(high.begin(), high.end(), make_pair(xx, yy));
      vector<pair<long long, long long> >::iterator lp1 = lp0--;
      vector<pair<long long, long long> >::iterator hp1 = hp0--;
      long long ldx = lp1->first - lp0->first;
      long long ldy = lp1->second - lp0->second;
      long long hdx = hp1->first - hp0->first;
      long long hdy = hp1->second - hp0->second;
      if (ldx * lp0->second - ldy * lp0->first + ldy * xx <= ldx * yy &&
          hdx * yy <= hdx * hp0->second - hdy * hp0->first + hdy * xx) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    } else {
      cout << "NO" << endl;
    }
  }
}