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;
bool is_upper(long long int x0, long long int y0, long long int x1,
              long long int y1, long long int X, long long int Y) {
  return (y1 - y0) * X + (x1 - x0) * y0 - (y1 - y0) * x0 < (x1 - x0) * Y;
}
bool is_lower(long long int x0, long long int y0, long long int x1,
              long long int y1, long long int X, long long int Y) {
  return (x1 - x0) * Y < (y1 - y0) * X + (x1 - x0) * y0 - (y1 - y0) * x0;
}
int main() {
  long long int x[3][50005], y[3][50005], n[3], stage;
  long long int p[3] = {0, 0, 0}, cnt[3] = {0, 0, 0};
  vector<long long int> vx, vy;
  for (long long int i = 0; i < ((long long int)(3)); i++) {
    cin >> n[i];
    for (long long int j = 0; j < ((long long int)(n[i])); j++)
      cin >> x[i][j] >> y[i][j];
  }
  for (long long int i = 0; i < ((long long int)(3)); i++)
    for (long long int j = 0; j < ((long long int)(n[i])); j++) {
      double d0 =
          atan2(y[i][(j + 1) % n[i]] - y[i][j], x[i][(j + 1) % n[i]] - x[i][j]);
      double d1 =
          atan2(y[i][p[i] + 1] - y[i][p[i]], x[i][p[i] + 1] - x[i][p[i]]);
      if (d0 < d1) p[i] = j;
    }
  vx.push_back(x[0][p[0]] + x[1][p[1]] + x[2][p[2]]);
  vy.push_back(y[0][p[0]] + y[1][p[1]] + y[2][p[2]]);
  while (n[0] != cnt[0] || n[1] != cnt[1] || n[2] != cnt[2]) {
    long long int t = -1;
    for (long long int i = 0; i < ((long long int)(3)); i++)
      if (n[i] != cnt[i]) {
        if (t == -1) {
          t = i;
          continue;
        }
        double d0 = atan2(y[i][(p[i] + 1) % n[i]] - y[i][p[i]],
                          x[i][(p[i] + 1) % n[i]] - x[i][p[i]]);
        double d1 = atan2(y[t][(p[t] + 1) % n[t]] - y[t][p[t]],
                          x[t][(p[t] + 1) % n[t]] - x[t][p[t]]);
        if (d0 < d1) t = i;
      }
    p[t] = (p[t] + 1) % n[t];
    cnt[t]++;
    vx.push_back(x[0][p[0]] + x[1][p[1]] + x[2][p[2]]);
    vy.push_back(y[0][p[0]] + y[1][p[1]] + y[2][p[2]]);
  }
  long long int m0 = 0, m1 = 0;
  for (long long int i = 0; i < ((long long int)(((long long int)vx.size())));
       i++) {
    if (vx[i] < vx[m0]) m0 = i;
    if (vx[m1] < vx[i]) m1 = i;
  }
  vector<pair<long long int, long long int> > _up, _down, up, down;
  for (long long int i = 0; i < ((long long int)(((long long int)vx.size())));
       i++) {
    if (!is_upper(vx[m0], vy[m0], vx[m1], vy[m1], vx[i], vy[i]))
      _down.push_back(make_pair(vx[i], vy[i]));
    if (!is_lower(vx[m0], vy[m0], vx[m1], vy[m1], vx[i], vy[i]))
      _up.push_back(make_pair(vx[i], vy[i]));
  }
  sort(_up.begin(), _up.end());
  sort(_down.begin(), _down.end());
  for (long long int i = 0; i < ((long long int)(((long long int)_up.size())));
       i++) {
    if (((long long int)up.size()) == 0 || up.back().first != _up[i].first)
      up.push_back(_up[i]);
    else
      up.back().second = max(up.back().second, _up[i].second);
  }
  for (long long int i = 0;
       i < ((long long int)(((long long int)_down.size()))); i++) {
    if (((long long int)down.size()) == 0 ||
        down.back().first != _down[i].first)
      down.push_back(_down[i]);
    else
      down.back().second = min(down.back().second, _down[i].second);
  }
  for (cin >> stage; stage--;) {
    long long int xx, yy;
    cin >> xx >> yy;
    xx *= 3;
    yy *= 3;
    vector<pair<long long int, long long int> >::iterator u1, u0, d1, d0;
    u0 = upper_bound(up.begin(), up.end(),
                     make_pair(xx, (1ll << (long long int)(60))));
    d0 = upper_bound(down.begin(), down.end(),
                     make_pair(xx, (1ll << (long long int)(60))));
    if (u0 == up.begin() || d0 == down.begin()) {
      cout << "NO" << endl;
      continue;
    }
    u1 = u0--;
    d1 = d0--;
    if (u1 == up.end()) {
      cout << ((xx == u0->first && d0->second <= yy && yy <= u0->second) ? "YES"
                                                                         : "NO")
           << endl;
      continue;
    }
    bool ok = true;
    if (is_upper(u0->first, u0->second, u1->first, u1->second, xx, yy))
      ok = false;
    if (is_lower(d0->first, d0->second, d1->first, d1->second, xx, yy))
      ok = false;
    cout << ((ok) ? "YES" : "NO") << endl;
  }
}