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 int M = 400010, mod = 1000000007;
const double PI = acos(-1.0);
inline int dcmp(double first) {
  if (fabs(first) < 1e-10)
    return 0;
  else
    return first < 0 ? -1 : 1;
}
inline double getDistance(double first, double second) {
  return sqrt(first * first + second * second);
}
class PT {
 public:
  double first, second;
  PT() {}
  PT(double first, double second) : first(first), second(second) {}
  PT(const PT& p) : first(p.first), second(p.second) {}
  double Magnitude() { return sqrt(first * first + second * second); }
  bool operator==(const PT& u) const {
    return dcmp(first - u.first) == 0 && dcmp(second - u.second) == 0;
  }
  bool operator!=(const PT& u) const { return !(*this == u); }
  bool operator<(const PT& u) const {
    return dcmp(first - u.first) < 0 ||
           (dcmp(first - u.first) == 0 && dcmp(second - u.second) < 0);
  }
  bool operator>(const PT& u) const { return u < *this; }
  bool operator<=(const PT& u) const { return *this < u || *this == u; }
  bool operator>=(const PT& u) const { return *this > u || *this == u; }
  PT operator+(const PT& u) const {
    return PT(first + u.first, second + u.second);
  }
  PT operator-(const PT& u) const {
    return PT(first - u.first, second - u.second);
  }
  PT operator*(const double u) const { return PT(first * u, second * u); }
  PT operator/(const double u) const { return PT(first / u, second / u); }
  double operator*(const PT& u) const {
    return first * u.second - second * u.first;
  }
};
double dot(PT p, PT q) { return p.first * q.first + p.second * q.second; }
double dist2(PT p, PT q) { return dot(p - q, p - q); }
double dist(PT p, PT q) { return sqrt(dist2(p, q)); }
double cross(PT p, PT q) { return p.first * q.second - p.second * q.first; }
double myAsin(double val) {
  if (val > 1) return PI * 0.5;
  if (val < -1) return -PI * 0.5;
  return asin(val);
}
double myAcos(double val) {
  if (val > 1) return 0;
  if (val < -1) return PI;
  return acos(val);
}
ostream& operator<<(ostream& os, const PT& p) {
  os << "(" << p.first << "," << p.second << ")";
}
PT RotateCCW90(PT p) { return PT(-p.second, p.first); }
PT RotateCW90(PT p) { return PT(p.second, -p.first); }
PT RotateCCW(PT p, double t) {
  return PT(p.first * cos(t) - p.second * sin(t),
            p.first * sin(t) + p.second * cos(t));
}
PT RotateAroundPointCCW(PT p, PT pivot, double t) {
  PT trans = p - pivot;
  PT ret = RotateCCW(trans, t);
  ret = ret + pivot;
  return ret;
}
PT ProjectPointLine(PT a, PT b, PT c) {
  return a + (b - a) * dot(c - a, b - a) / dot(b - a, b - a);
}
double DistancePointLine(PT a, PT b, PT c) {
  return dist(c, ProjectPointLine(a, b, c));
}
PT ProjectPointSegment(PT a, PT b, PT c) {
  double r = dot(b - a, b - a);
  if (fabs(r) < 1e-10) return a;
  r = dot(c - a, b - a) / r;
  if (r < 0) return a;
  if (r > 1) return b;
  return a + (b - a) * r;
}
double DistancePointSegment(PT a, PT b, PT c) {
  return sqrt(dist2(c, ProjectPointSegment(a, b, c)));
}
double DistancePointPlane(double first, double second, double z, double a,
                          double b, double c, double d) {
  return fabs(a * first + b * second + c * z - d) / sqrt(a * a + b * b + c * c);
}
bool LinesParallel(PT a, PT b, PT c, PT d) {
  return dcmp(cross(b - a, c - d)) == 0;
}
bool LinesCollinear(PT a, PT b, PT c, PT d) {
  return LinesParallel(a, b, c, d) && dcmp(cross(a - b, a - c)) == 0 &&
         dcmp(cross(c - d, c - a)) == 0;
}
bool SegmentsIntersect(PT a, PT b, PT c, PT d) {
  if (LinesCollinear(a, b, c, d)) {
    if (dcmp(dist2(a, c)) == 0 || dcmp(dist2(a, d)) == 0 ||
        dcmp(dist2(b, c)) == 0 || dcmp(dist2(b, d)) == 0)
      return true;
    if (dcmp(dot(c - a, c - b)) > 0 && dcmp(dot(d - a, d - b)) > 0 &&
        dcmp(dot(c - b, d - b)) > 0)
      return false;
    return true;
  }
  if (dcmp(cross(d - a, b - a)) * dcmp(cross(c - a, b - a)) > 0) return false;
  if (dcmp(cross(a - c, d - c)) * dcmp(cross(b - c, d - c)) > 0) return false;
  return true;
}
PT ComputeLineIntersection(PT a, PT b, PT c, PT d) {
  b = b - a;
  d = c - d;
  c = c - a;
  assert(dot(b, b) > 1e-10 && dot(d, d) > 1e-10);
  return a + b * cross(c, d) / cross(b, d);
}
PT ComputeCircleCenter(PT a, PT b, PT c) {
  b = (a + b) / 2;
  c = (a + c) / 2;
  return ComputeLineIntersection(b, b + RotateCW90(a - b), c,
                                 c + RotateCW90(a - c));
}
bool PointOnSegment(PT p, PT s, PT e) {
  if (p == s || p == e) return 1;
  return dcmp(cross(s - p, s - e)) == 0 &&
         dcmp(dot(PT(s.first - p.first, s.second - p.second),
                  PT(e.first - p.first, e.second - p.second))) < 0;
}
int PointInPolygon(vector<PT> p, PT q) {
  int i, j, cnt = 0;
  int n = p.size();
  for (i = 0, j = n - 1; i < n; j = i++) {
    if (PointOnSegment(q, p[i], p[j])) return 1;
    if (p[i].second > q.second != p[j].second > q.second &&
        q.first < (double)(p[j].first - p[i].first) * (q.second - p[i].second) /
                          (double)(p[j].second - p[i].second) +
                      p[i].first)
      cnt++;
  }
  return cnt & 1;
}
bool PointOnPolygon(const vector<PT>& p, PT q) {
  for (int i = 0; i < p.size(); i++)
    if (dist2(ProjectPointSegment(p[i], p[(i + 1) % p.size()], q), q) < 1e-10)
      return true;
  return false;
}
vector<PT> CircleLineIntersection(PT a, PT b, PT c, double r) {
  vector<PT> ret;
  b = b - a;
  a = a - c;
  double A = dot(b, b);
  double B = dot(a, b);
  double C = dot(a, a) - r * r;
  double D = B * B - A * C;
  if (D < -1e-10) return ret;
  ret.push_back(c + a + b * (-B + sqrt(D + 1e-10)) / A);
  if (D > 1e-10) ret.push_back(c + a + b * (-B - sqrt(D)) / A);
  return ret;
}
vector<PT> CircleCircleIntersection(PT a, PT b, double r, double R) {
  vector<PT> ret;
  double d = sqrt(dist2(a, b));
  if (d > r + R || d + min(r, R) < max(r, R)) return ret;
  double first = (d * d - R * R + r * r) / (2 * d);
  double second = sqrt(r * r - first * first);
  PT v = (b - a) / d;
  ret.push_back(a + v * first + RotateCCW90(v) * second);
  if (second > 0) ret.push_back(a + v * first - RotateCCW90(v) * second);
  return ret;
}
double ComputeSignedArea(const vector<PT>& p) {
  double area = 0;
  for (int i = 0; i < p.size(); i++) {
    int j = (i + 1) % p.size();
    area += p[i].first * p[j].second - p[j].first * p[i].second;
  }
  return area / 2.0;
}
double ComputeArea(const vector<PT>& p) { return fabs(ComputeSignedArea(p)); }
double ShoeLace(vector<PT>& vec) {
  int i, n;
  double ans = 0;
  n = vec.size();
  for (i = 0; i < n; i++)
    ans += vec[i].first * vec[((i + 1) % n)].second -
           vec[i].second * vec[((i + 1) % n)].first;
  return fabs(ans) * 0.5;
}
PT ComputeCentroid(const vector<PT>& p) {
  PT c(0, 0);
  double scale = 6.0 * ComputeSignedArea(p);
  for (int i = 0; i < p.size(); i++) {
    int j = (i + 1) % p.size();
    c = c +
        (p[i] + p[j]) * (p[i].first * p[j].second - p[j].first * p[i].second);
  }
  return c / scale;
}
double PAngle(PT a, PT b, PT c) {
  PT temp1(a.first - b.first, a.second - b.second),
      temp2(c.first - b.first, c.second - b.second);
  double ans =
      myAsin((temp1.first * temp2.second - temp1.second * temp2.first) /
             (temp1.Magnitude() * temp2.Magnitude()));
  if ((ans < 0 &&
       (temp1.first * temp2.first + temp1.second * temp2.second) < 0) ||
      (ans >= 0 &&
       (temp1.first * temp2.first + temp1.second * temp2.second) < 0))
    ans = PI - ans;
  ans = ans < 0 ? 2 * PI + ans : ans;
  return ans;
}
double SignedArea(PT a, PT b, PT c) {
  PT temp1(b.first - a.first, b.second - a.second),
      temp2(c.first - a.first, c.second - a.second);
  return (temp1.first * temp2.second - temp1.second * temp2.first);
}
bool XYasscending(PT a, PT b) {
  if (abs(a.first - b.first) < 1e-10) return a.second < b.second;
  return a.first < b.first;
}
void MakeConvexHull(vector<PT> given, vector<PT>& ans) {
  int i, n = given.size(), j = 0, k = 0;
  vector<PT> U, L;
  ans.clear();
  sort(given.begin(), given.end(), XYasscending);
  for (i = 0; i < n; i++) {
    while (true) {
      if (j < 2) break;
      if (SignedArea(L[j - 2], L[j - 1], given[i]) <= 1e-10)
        j--;
      else
        break;
    }
    if (j == L.size()) {
      L.push_back(given[i]);
      j++;
    } else {
      L[j] = given[i];
      j++;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    while (1) {
      if (k < 2) break;
      if (SignedArea(U[k - 2], U[k - 1], given[i]) <= 1e-10)
        k--;
      else
        break;
    }
    if (k == U.size()) {
      U.push_back(given[i]);
      k++;
    } else {
      U[k] = given[i];
      k++;
    }
  }
  for (i = 0; i < j - 1; i++) ans.push_back(L[i]);
  for (i = 0; i < k - 1; i++) ans.push_back(U[i]);
}
struct DirLine {
  PT p;
  PT v;
  double ang;
  DirLine() {}
  DirLine(PT p, PT q) {
    this->p = p;
    this->v.first = q.first - p.first;
    this->v.second = q.second - p.second;
    ang = atan2(v.second, v.first);
  }
  bool operator<(const DirLine& u) const { return ang < u.ang; }
};
bool getIntersection(PT p, PT v, PT q, PT w, PT& o) {
  if (dcmp(cross(v, w)) == 0) return false;
  PT u = p - q;
  double k = cross(w, u) / cross(v, w);
  o = p + v * k;
  return true;
}
bool onLeft(DirLine l, PT p) { return dcmp(l.v * (p - l.p)) >= 0; }
int halfPlaneIntersection(DirLine* li, int n, PT* poly) {
  sort(li, li + n);
  int first, last;
  PT* p = new PT[n];
  DirLine* q = new DirLine[n];
  q[first = last = 0] = li[0];
  for (int i = 1; i < n; i++) {
    while (first < last && !onLeft(li[i], p[last - 1])) last--;
    while (first < last && !onLeft(li[i], p[first])) first++;
    q[++last] = li[i];
    if (dcmp(q[last].v * q[last - 1].v) == 0) {
      last--;
      if (onLeft(q[last], li[i].p)) q[last] = li[i];
    }
    if (first < last)
      getIntersection(q[last - 1].p, q[last - 1].v, q[last].p, q[last].v,
                      p[last - 1]);
  }
  while (first < last && !onLeft(q[first], p[last - 1])) last--;
  if (last - first <= 1) {
    delete[] p;
    delete[] q;
    return 0;
  }
  getIntersection(q[last].p, q[last].v, q[first].p, q[first].v, p[last]);
  int m = 0;
  for (int i = first; i <= last; i++) poly[m++] = p[i];
  delete[] p;
  delete[] q;
  return m;
}
void MKConvexHull(vector<PT>& convexhull, vector<PT> h1, vector<PT> h2) {
  int n = h1.size(), m = h2.size();
  vector<PT> h;
  PT c = PT(0, 0);
  for (int i = 0; i < m; i++) c = c + h2[i];
  c = c / m;
  for (int i = 0; i < m; i++) h2[i] = h2[i] - c;
  int cur = -1;
  for (int i = 0; i < m; i++) {
    if (dcmp(cross(h2[i], h1[0] - h1[n - 1])) >= 0) {
      if (cur == -1 ||
          cross(h2[i], h1[0] - h1[n - 1]) > cross(h2[cur], h1[0] - h1[n - 1]))
        cur = i;
    }
  }
  int cnt = 0;
  h1.push_back(h1[0]);
  for (int i = 0; i < n; i++) {
    while (true) {
      h.push_back(h1[i] + h2[cur]);
      int next = (cur == m - 1 ? 0 : cur + 1);
      if (dcmp(cross(h2[cur], h1[i + 1] - h1[i])) < 0)
        cur = next;
      else {
        if (cross(h2[next], h1[i + 1] - h1[i]) >
            cross(h2[cur], h1[i + 1] - h1[i]))
          cur = next;
        else
          break;
      }
    }
  }
  for (int i = 0; i < h.size(); i++) h[i] = h[i] + c;
  for (int i = 0; i < m; i++) h2[i] = h2[i] + c;
  MakeConvexHull(h, convexhull);
}
bool PointInConvexPolygon(vector<PT>& h, PT p) {
  int n = h.size();
  double a1 = SignedArea(p, h[0], h[1]), a2 = SignedArea(p, h[0], h[n - 1]);
  if (dcmp(a1) == -1 || dcmp(a2) == 1) return false;
  int l = 1, r = n - 1;
  while (l < r - 1) {
    int m = (l + r) / 2;
    double a = SignedArea(p, h[0], h[m]);
    if (dcmp(a) == -1)
      r = m;
    else if (dcmp(a) == 1)
      l = m;
    else
      return PointOnSegment(p, h[0], h[m]);
  }
  if (l == r)
    return PointOnSegment(p, h[0], h[l]);
  else
    return dcmp(SignedArea(p, h[l], h[r])) >= 0;
}
vector<PT> a, b, c, h, hh, hhh;
int main() {
  ios_base::sync_with_stdio(false);
  int n, i, j, k;
  double first, second;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%lf%lf", &first, &second), a.push_back(PT(first, second));
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%lf%lf", &first, &second), b.push_back(PT(first, second));
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%lf%lf", &first, &second), c.push_back(PT(first, second));
  MKConvexHull(hh, a, b);
  MKConvexHull(h, hh, c);
  scanf("%d", &n);
  while (n--) {
    scanf("%lf%lf", &first, &second);
    PT tmp = PT(first, second) * 3.0;
    if (PointInConvexPolygon(h, tmp))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}