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;
const double eps = 1e-8;
inline double sqr(double x) { return x * x; }
int cmp(double x) { return fabs(x) < eps ? 0 : (x > 0 ? 1 : -1); }
namespace Point {
struct pt {
  double x, y;
  pt() {}
  pt(double a, double b) : x(a), y(b) {}
  void input() { scanf("%lf%lf", &x, &y); }
  friend pt operator+(const pt &a, const pt &b) {
    return pt(a.x + b.x, a.y + b.y);
  }
  friend pt operator-(const pt &a, const pt &b) {
    return pt(a.x - b.x, a.y - b.y);
  }
  friend bool operator==(const pt &a, const pt &b) {
    return !cmp(a.x - b.x) && !cmp(a.y - b.y);
  }
  friend pt operator*(const pt &a, const double &b) {
    return pt(a.x * b, a.y * b);
  }
  friend pt operator*(const double &a, const pt &b) {
    return pt(a * b.x, a * b.y);
  }
  friend pt operator/(const pt &a, const double &b) {
    return pt(a.x / b, a.y / b);
  }
  friend bool operator<(const pt &a, const pt &b) {
    return cmp(a.x - b.x) < 0 || (cmp(a.x - b.x) == 0 && cmp(a.y - b.y) < 0);
  }
  double norm() { return sqrt(sqr(x) + sqr(y)); }
};
double det(const pt &a, const pt &b) { return a.x * b.y - a.y * b.x; }
double dot(const pt &a, const pt &b) { return a.x * b.x + a.y * b.y; }
double dist(const pt &a, const pt &b) { return (a - b).norm(); }
pt rotate_point(const pt &p, double A) {
  double tx = p.x, ty = p.y;
  return pt(tx * cos(A) - ty * sin(A), tx * sin(A) + ty * cos(A));
}
}  // namespace Point
using namespace Point;
namespace Convex {
struct conv {
  vector<pt> P;
  conv(int sz = 0) { P.resize(sz); }
};
conv get_convex(vector<pt> a) {
  conv res(2 * (int)a.size() + 5);
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  int m = 0, sz = (int)a.size();
  ;
  for (int i = 0; i < sz; i++) {
    while (m > 1 &&
           cmp(det(res.P[m - 1] - res.P[m - 2], a[i] - res.P[m - 2])) <= 0)
      m--;
    res.P[m++] = a[i];
  }
  int k = m;
  for (int i = sz - 2; i >= 0; i--) {
    while (m > k &&
           cmp(det(res.P[m - 1] - res.P[m - 2], a[i] - res.P[m - 2])) <= 0)
      m--;
    res.P[m++] = a[i];
  }
  res.P.resize(m);
  if (sz > 1) res.P.resize(m - 1);
  return res;
}
int containOlogn(const conv &a, const pt &b) {
  int n = (int)a.P.size();
  pt g = (a.P[0] + a.P[n / 3] + a.P[2 * n / 3]) / 3.0;
  int l = 0, r = n;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    int dl = cmp(det(a.P[l] - g, b - g));
    if (cmp(det(a.P[l] - g, a.P[mid] - g)) > 0) {
      if (dl >= 0 && cmp(det(a.P[mid] - g, b - g)) < 0)
        r = mid;
      else
        l = mid;
    } else {
      if (cmp(det(a.P[l] - g, b - g)) < 0 && cmp(det(a.P[mid] - g, b - g)) >= 0)
        l = mid;
      else
        r = mid;
    }
  }
  r %= n;
  int z = cmp(det(a.P[r] - b, a.P[l] - b)) - 1;
  if (z == -2) return 1;
  return z;
}
}  // namespace Convex
using namespace Convex;
conv Minkowski(conv C1, conv C2) {
  size_t n = C1.P.size(), m = C2.P.size();
  vector<pt> s1(n), s2(m), x;
  for (int i = 0; i < n - 1; i++) s1[i] = C1.P[i + 1] - C1.P[i];
  s1[n - 1] = C1.P[0] - C1.P[n - 1];
  for (int i = 0; i < m - 1; i++) s2[i] = C2.P[i + 1] - C2.P[i];
  s2[m - 1] = C2.P[0] - C2.P[m - 1];
  x.push_back(C1.P[0] + C2.P[0]);
  int p1 = 0, p2 = 0;
  while (p1 < n && p2 < m) {
    pt tmp = det(s1[p1], s2[p2]) >= 0 ? s1[p1++] : s2[p2++];
    x.push_back(x.back() + tmp);
  }
  while (p1 < n) x.push_back(x.back() + s1[p1++]);
  while (p2 < m) x.push_back(x.back() + s2[p2++]);
  return get_convex(x);
}
int main(int argc, const char *argv[]) {
  int a[3];
  vector<pt> _a[3];
  conv A[3];
  for (int i = 0; i < 3; i++) {
    scanf("%d", &a[i]);
    _a[i].resize(a[i]);
    for (auto &p : _a[i]) p.input();
    A[i] = get_convex(_a[i]);
  }
  conv res = Minkowski(A[0], Minkowski(A[1], A[2]));
  int q;
  scanf("%d", &q);
  while (q--) {
    pt x;
    x.input();
    x = x * 3;
    if (containOlogn(res, x))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}