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;
struct hull {
  map<int, int> points;
  long long area;
  inline hull() {
    points.clear();
    area = 0;
  }
  inline map<int, int>::iterator prev(map<int, int>::iterator it) {
    return it == points.begin() ? it : --it;
  }
  inline map<int, int>::iterator next(map<int, int>::iterator it) {
    return it == points.end() ? it : ++it;
  }
  inline long long traparea(long long x1, long long y1, long long x2,
                            long long y2) {
    return (x2 - x1) * (y1 + y2);
  }
  inline long long triarea(long long x1, long long y1, long long x2,
                           long long y2, long long x3, long long y3) {
    return traparea(x1, y1, x2, y2) + traparea(x2, y2, x3, y3) +
           traparea(x3, y3, x1, y1);
  }
  inline long long traparea(map<int, int>::iterator a,
                            map<int, int>::iterator b) {
    return traparea(a->first, a->second, b->first, b->second);
  }
  inline long long triarea(map<int, int>::iterator it) {
    long long sum = 0;
    if (it != points.begin()) sum += traparea(prev(it), it);
    if (next(it) != points.end()) sum += traparea(it, next(it));
    if (it != points.begin() && next(it) != points.end())
      sum += traparea(next(it), prev(it));
    return sum;
  }
  inline bool bad(map<int, int>::iterator it) {
    if (points.size() < 3 || it == points.begin() || next(it) == points.end())
      return false;
    return triarea(it) <= 0;
  }
  inline void insert(int x, int y) {
    if (points.find(x) != points.end()) {
      if (y <= points[x]) return;
      area -= triarea(points.lower_bound(x));
      points.erase(x);
    }
    map<int, int>::iterator it = points.insert(make_pair(x, y)).first;
    if (bad(it)) {
      points.erase(it);
      return;
    }
    area += triarea(it);
    while (bad(prev(it))) {
      area -= triarea(prev(it));
      points.erase(prev(it));
    }
    while (bad(next(it))) {
      area -= triarea(next(it));
      points.erase(next(it));
    }
  }
  inline bool contains(int x, int y) {
    map<int, int>::iterator first = points.begin(), last = prev(points.end());
    if (x < first->first || x > last->first) return false;
    if (x == first->first) return y <= first->second;
    if (x == last->first) return y <= last->second;
    map<int, int>::iterator it = points.lower_bound(x), p = prev(it);
    int x1 = p->first, y1 = p->second, x2 = it->first, y2 = it->second;
    return (long long)(y - y1) * (x2 - x1) <= (long long)(x - x1) * (y2 - y1);
  }
};
template <typename T>
inline pair<T, T> to_pair(complex<T> x) {
  return make_pair(x.real(), x.imag());
}
inline long long cross(complex<int> a, complex<int> b) {
  return (long long)a.real() * b.imag() - (long long)b.real() * a.imag();
}
vector<complex<int> > minkowski_sum(vector<complex<int> > a,
                                    vector<complex<int> > b) {
  int n = a.size(), m = b.size();
  int aind = -1, bind = -1;
  for (int i = 0; i < n; i++)
    if (aind == -1 || to_pair(a[i]) < to_pair(a[aind])) aind = i;
  for (int i = 0; i < m; i++)
    if (bind == -1 || to_pair(b[i]) < to_pair(b[bind])) bind = i;
  vector<complex<int> > sum;
  sum.reserve(n + m);
  bool alooped = false, blooped = false;
  int i = aind, j = bind;
  while (!(i == aind && alooped) || !(j == bind && blooped)) {
    complex<int> pa = a[(i + 1) % n] - a[i], pb = b[(j + 1) % m] - b[j];
    if ((j == bind && blooped) || cross(pa, pb) > 0) {
      sum.push_back(a[i] + b[j] + pa);
      i = (i + 1) % n;
      alooped |= i == 0;
    } else {
      sum.push_back(a[i] + b[j] + pb);
      j = (j + 1) % m;
      blooped |= j == 0;
    }
  }
  return sum;
}
vector<complex<int> > A, B, C;
void input(vector<complex<int> > &P) {
  int n;
  scanf("%d", &n);
  for (int x, y, i = 0; i < n; i++) {
    scanf("%d %d", &x, &y);
    P.push_back(complex<int>(x, y));
  }
}
hull upper, lower;
int main() {
  input(A);
  input(B);
  input(C);
  vector<complex<int> > X = minkowski_sum(A, B);
  X = minkowski_sum(X, C);
  for (int i = 0; i < (int)X.size(); i++) {
    upper.insert(X[i].real(), X[i].imag());
    lower.insert(X[i].real(), -X[i].imag());
  }
  int M;
  scanf("%d", &M);
  for (int x, y, i = 0; i < M; i++) {
    scanf("%d %d", &x, &y);
    puts(upper.contains(3 * x, 3 * y) && lower.contains(3 * x, -3 * y) ? "YES"
                                                                       : "NO");
  }
  return 0;
}