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>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
int n;
int m;
int x[222222];
int y[222222];
int X[211111];
int Y[211111];
int xt[222222];
int yt[222222];
double mn[111111];
double MX[111111];
void change(int *x, int *y, int n) {
  int pos = 0;
  for (int i(0); i < (n); i++)
    if (x[i] < x[pos] || x[i] == x[pos] && y[i] > y[pos]) pos = i;
  for (int i(0); i < (n); i++)
    xt[i] = x[(i + pos) % n], yt[i] = y[(i + pos) % n];
  for (int i(0); i < (n); i++) x[i] = xt[i], y[i] = yt[i];
}
bool better(long long x, long long y, long long x1, long long y1, long long x2,
            long long y2) {
  long long q = (x1 - x) * (y2 - y) - (x2 - x) * (y1 - y);
  if (q) return q < 0;
  return (x - x1) * (x - x1) + (y - y1) * (y - y1) >
         (y - y2) * (y - y2) + (x - x2) * (x - x2);
}
void un() {
  int N = 0;
  x[n] = x[0], y[n] = y[0];
  X[m] = X[0], Y[m] = Y[0];
  int p1 = 0;
  int p2 = 0;
  while (1) {
    xt[N] = x[p1] + X[p2];
    yt[N] = y[p1] + Y[p2];
    N++;
    if (N == n + m) break;
    int x1 = x[p1] + X[p2 + 1];
    int y1 = y[p1] + Y[p2 + 1];
    int x2 = x[p1 + 1] + X[p2];
    int y2 = y[p1 + 1] + Y[p2];
    if (better(xt[N - 1], yt[N - 1], x1, y1, x2, y2))
      p2++;
    else
      p1++;
  }
  for (int i(0); i < (N); i++) x[i] = xt[i], y[i] = yt[i];
  n = N;
}
pair<pair<int, int>, int> p[111111];
const double eps = 1e-9;
int main() {
  cin >> n;
  for (int j(0); j < (n); j++) scanf("%d %d", &x[j], &y[j]);
  reverse(x, x + n);
  reverse(y, y + n);
  change(x, y, n);
  for (int i(0); i < (2); i++) {
    cin >> m;
    for (int j(0); j < (m); j++) scanf("%d %d", &X[j], &Y[j]);
    reverse(X, X + m);
    reverse(Y, Y + m);
    change(X, Y, m);
    un();
  }
  cin >> m;
  for (int i(0); i < (m); i++) {
    scanf("%d %d", X + i, Y + i);
    p[i] = pair<pair<int, int>, int>(pair<int, int>(3 * X[i], Y[i]), i);
    mn[i] = 1e100;
    MX[i] = -1e100;
  }
  sort(p, p + m);
  x[n] = x[0], y[n] = y[0];
  for (int i(0); i < (n); i++) {
    int xf = min(x[i], x[i + 1]);
    int xe = max(x[i], x[i + 1]);
    int pos = lower_bound(p, p + m,
                          pair<pair<int, int>, int>(
                              pair<int, int>(xf, -2000000000), 0)) -
              p;
    while (pos < m) {
      if (p[pos].first.first > xe) break;
      int ver = p[pos].second;
      if (xf == xe) {
        mn[ver] = min(mn[ver], 0. + min(y[i], y[i + 1]));
        MX[ver] = max(MX[ver], 0. + max(y[i], y[i + 1]));
      } else {
        double Y = y[i] + (y[i + 1] - y[i]) *
                              double(p[pos].first.first - x[i]) /
                              double(x[i + 1] - x[i]);
        mn[ver] = min(mn[ver], Y);
        MX[ver] = max(MX[ver], Y);
      }
      pos++;
    }
  }
  for (int i(0); i < (m); i++) {
    puts(3 * Y[i] >= mn[i] - eps && 3 * Y[i] <= MX[i] + eps ? "YES" : "NO");
  }
  return 0;
}