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 point {
  double x, y;
  point() { x = y = 0.0; }
  point(double _x, double _y) : x(_x), y(_y) {}
  double norm() { return hypot(x, y); }
  point normalized() { return point(x, y) * (1.0 / norm()); }
  double angle() { return atan2(y, x); }
  double polarAngle() {
    double a = atan2(y, x);
    return a < 0 ? a + 2 * M_PI : a;
  }
  bool operator<(point other) const {
    if (fabs(x - other.x) > 1e-9)
      return x < other.x;
    else
      return y < other.y;
  }
  bool operator==(point other) const {
    return (fabs(x - other.x) < 1e-9 && (fabs(y - other.y) < 1e-9));
  }
  point operator+(point other) const { return point(x + other.x, y + other.y); }
  point operator-(point other) const { return point(x - other.x, y - other.y); }
  point operator*(double k) const { return point(x * k, y * k); }
};
double dist(point p1, point p2) { return hypot(p1.x - p2.x, p1.y - p2.y); }
double inner(point p1, point p2) { return p1.x * p2.x + p1.y * p2.y; }
double cross(point p1, point p2) { return p1.x * p2.y - p1.y * p2.x; }
bool ccw(point p, point q, point r) { return cross(q - p, r - p) > 0; }
bool collinear(point p, point q, point r) {
  return fabs(cross(p - q, r - p)) < 1e-9;
}
point rotate(point p, double rad) {
  return point(p.x * cos(rad) - p.y * sin(rad),
               p.x * sin(rad) + p.y * cos(rad));
}
double angle(point a, point o, point b) {
  return acos(inner(a - o, b - o) / (dist(o, a) * dist(o, b)));
}
point proj(point u, point v) { return v * (inner(u, v) / inner(v, v)); }
bool between(point p, point q, point r) {
  return collinear(p, q, r) && inner(p - q, r - q) <= 0;
}
int leftmostIndex(vector<point> &P) {
  int ans = 0;
  for (int i = 1; i < (int)P.size(); i++) {
    if (P[i] < P[ans]) ans = i;
  }
  return ans;
}
struct polygon {
  vector<point> P;
  polygon() {}
  polygon(vector<point> _P) : P(_P) {
    if (!P.empty() && !(P.back() == P.front())) P.push_back(P[0]);
    if (signedArea() < 0.0) {
      for (int i = 0; 2 * i < (int)P.size(); i++) {
        swap(P[i], P[P.size() - i - 1]);
      }
    }
  }
  double signedArea() {
    double result = 0.0;
    for (int i = 0; i < (int)P.size() - 1; i++) {
      result += cross(P[i], P[i + 1]);
    }
    return result / 2.0;
  }
  bool inPolygon(point p) {
    if (P.size() == 0u) return false;
    double sum = 0.0;
    for (int i = 0; i < (int)P.size() - 1; i++) {
      if (ccw(p, P[i], P[i + 1]))
        sum += angle(P[i], p, P[i + 1]);
      else
        sum -= angle(P[i], p, P[i + 1]);
    }
    return fabs(fabs(sum) - 2 * M_PI) < 1e-9;
  }
};
polygon minkowski(polygon p1, polygon p2) {
  vector<point> &A = p1.P, &B = p2.P, P;
  A.pop_back();
  B.pop_back();
  int s1 = leftmostIndex(A), n1 = A.size();
  int s2 = leftmostIndex(B), n2 = B.size();
  P.push_back(A[s1] + B[s2]);
  int i = s1 + 1, j = s2 + 1, c1 = 0, c2 = 0;
  point v1, v2;
  while (c1 < n1 || c2 < n2) {
    v1 = A[i] - A[(i - 1 + n1) % n1];
    v2 = B[j] - B[(j - 1 + n2) % n2];
    if (c2 == n2 || (c1 < n1 && cross(v1, v2) > 0)) {
      P.push_back(P.back() + v1);
      i = (i + 1) % n1;
      c1++;
    } else if (c1 == n1 || (c2 < n2 && cross(v1, v2) < 0)) {
      P.push_back(P.back() + v2);
      j = (j + 1) % n2;
      c2++;
    } else {
      P.push_back(P.back() + (v1 + v2));
      i = (i + 1) % n1;
      c1++;
      j = (j + 1) % n2;
      c2++;
    }
  }
  return polygon(P);
}
bool test() {
  int n;
  double x, y;
  vector<point> p1, p2, m;
  printf("insert polygon 1:\n");
  scanf("%d", &n);
  while (n--) {
    scanf("%lf %lf", &x, &y);
    p1.push_back(point(x, y));
  }
  printf("insert polygon 2:\n");
  scanf("%d", &n);
  while (n--) {
    scanf("%lf %lf", &x, &y);
    p2.push_back(point(x, y));
  }
  printf("minkowski sum:\n");
  m = minkowski(polygon(p1), polygon(p2)).P;
  for (int i = 0; i < (int)m.size(); i++) {
    printf("%.2f %.2f\n", m[i].x, m[i].y);
  }
  return true;
}
struct triangle {
  point a, b, c;
  triangle() { a = b = c = point(); }
  triangle(point _a, point _b, point _c) : a(_a), b(_b), c(_c) {}
  int isInside(point p) {
    double u = cross(b - a, p - a) * cross(b - a, c - a);
    double v = cross(c - b, p - b) * cross(c - b, a - b);
    double w = cross(a - c, p - c) * cross(a - c, b - c);
    if (u > 0.0 && v > 0.0 && w > 0.0) return 0;
    if (u < 0.0 || v < 0.0 || w < 0.0)
      return 2;
    else
      return 1;
  }
};
int isInsideTriangle(point a, point b, point c, point p) {
  return triangle(a, b, c).isInside(p);
}
point pivot(0, 0);
bool angleCmp(point a, point b) {
  if (collinear(pivot, a, b)) return dist(pivot, a) < dist(pivot, b);
  double d1x = a.x - pivot.x, d1y = a.y - pivot.y;
  double d2x = b.x - pivot.x, d2y = b.y - pivot.y;
  return atan2(d1y, d1x) - atan2(d2y, d2x) < 0;
}
bool query(vector<point> &CH, point q) {
  int i = 2, j = CH.size() - 1, m;
  pivot = CH[1];
  while (j > i + 1) {
    int m = (i + j) / 2;
    if (angleCmp(q, CH[m]))
      j = m;
    else
      i = m;
  }
  return isInsideTriangle(pivot, CH[i], CH[j], q) != 2;
}
void printpolygon(polygon p) {
  printf("printing polygon:\n");
  for (int i = 0; i < (int)p.P.size(); i++) {
    printf("%.2f %.2f\n", p.P[i].x, p.P[i].y);
  }
}
int main() {
  polygon city[3], sum;
  vector<point> P;
  double x, y;
  for (int i = 0, n; i < 3; i++) {
    scanf("%d", &n);
    P.clear();
    while (n--) {
      scanf("%lf %lf", &x, &y);
      P.push_back(point(x, y));
    }
    city[i] = polygon(P);
  }
  sum = minkowski(city[0], city[1]);
  sum = minkowski(sum, city[2]);
  P = sum.P;
  for (int i = (int)P.size() - 1; i > 0; i--) {
    P[i] = P[i - 1];
  }
  P[0] = P.back();
  int m;
  scanf("%d", &m);
  while (m--) {
    scanf("%lf %lf", &x, &y);
    if (query(P, point(x, y) * 3.0))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}