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 MAXN = int(5e4) + 100;
const int MOD = int(360);
const int oo = INT_MAX;
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
struct pt {
  long double x, y;
  pt() {}
  pt(long double x, long double y) : x(x), y(y) {}
};
inline long double x(pt P) { return P.x; }
inline long double y(pt P) { return P.y; }
istream& operator>>(istream& in, pt& p) {
  long double x, y;
  in >> x >> y;
  p = pt(x, y);
  return in;
}
ostream& operator<<(ostream& out, const pt& p) {
  out << "(" << double(p.x) << ", " << double(p.y) << ")";
  return out;
}
pt operator+(const pt& A, const pt& B) { return pt(x(A) + x(B), y(A) + y(B)); }
pt operator-(const pt& A, const pt& B) { return pt(x(A) - x(B), y(A) - y(B)); }
pt operator*(const pt& A, const pt& B) {
  return pt(x(A) * x(B) - y(A) * y(B), x(A) * y(B) + y(A) * x(B));
}
pt operator*(const pt& A, const long double& B) {
  return pt(x(A) * B, y(A) * B);
}
pt operator*(const long double& B, const pt& A) {
  return pt(x(A) * B, y(A) * B);
}
pt operator/(const pt& A, const long double& B) {
  return pt(x(A) / B, y(A) / B);
}
inline long double norm(pt A) { return x(A) * x(A) + y(A) * y(A); }
inline long double abs(pt A) { return sqrt(norm(A)); }
inline long double cross(pt A, pt B) { return x(A) * y(B) - y(A) * x(B); }
inline long double dot(pt A, pt B) { return x(A) * x(B) + y(A) * y(B); }
inline bool same(long double a, long double b) {
  return a + EPS > b && b + EPS > a;
}
inline bool samePt(pt A, pt B) { return same(x(A), x(B)) && same(y(A), y(B)); }
inline long double dist(pt A, pt B) { return abs(B - A); }
inline pt rotcw(pt p) { return p * pt(0, -1); }
inline bool segContains(pt X, pt A, pt B) {
  if (samePt(X, A) || samePt(X, B)) return 1;
  if (!same(0, cross(A - X, B - X))) return 0;
  return (dot(A - X, B - X) < EPS);
}
pt linesIntersection(pt A, pt B, pt C, pt D) {
  long double x = cross(C, D - C) - cross(A, D - C);
  x /= cross(B - A, D - C);
  return A + x * (B - A);
}
double signedArea(const vector<pt>& P) {
  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;
}
vector<pt> reorganize(vector<pt>& P) {
  int n = int(P.size());
  vector<pt> R(n);
  if (P.size() == 1) {
    R[0] = P[0];
    return R;
  }
  if (signedArea(P) > EPS) {
    reverse(P.begin(), P.end());
  }
  int s = 0;
  for (int i = 1; i < n; ++i) {
    if (x(P[s]) > x(P[i]) || (x(P[s]) == x(P[i]) && y(P[s]) > y(P[i]))) {
      s = i;
    }
  }
  R[0] = P[s];
  for (int i = (s + 1) % n, j = 1; i != s; i = (i + 1) % n, ++j) {
    if (samePt(P[i], P[(i - 1 + n) % n])) {
      j--;
      continue;
    }
    R[j] = P[i];
  }
  R[n - 1] = R[0];
  return R;
}
vector<pt> convexPolygonSum(vector<pt>& P, vector<pt>& Q) {
  P = reorganize(P);
  Q = reorganize(Q);
  int n = int(P.size()), m = int(Q.size());
  vector<pt> R(n + m - 1);
  R[0] = (P[0] + Q[0]);
  int i = 1, j = 1, k = 1;
  for (; i < n && j < m; ++k) {
    if (cross(P[i] - P[i - 1], Q[j] - Q[j - 1]) < -EPS) {
      R[k] = R[k - 1] + (P[i] - P[i - 1]);
      ++i;
    } else {
      R[k] = R[k - 1] + (Q[j] - Q[j - 1]);
      ++j;
    }
  }
  while (i < n) {
    R[k] = R[k - 1] + (P[i] - P[i - 1]);
    ++i;
    ++k;
  }
  while (j < m) {
    R[k] = R[k - 1] + (Q[j] - Q[j - 1]);
    ++j;
    ++k;
  }
  vector<pt> T;
  T.push_back(R[0]);
  for (int i = 1; i + 1 < int(R.size()); ++i) {
    if (same(cross(R[i] - R[i - 1], R[i + 1] - R[i - 1]), 0.0)) continue;
    T.push_back(R[i]);
  }
  T.push_back(T[0]);
  return T;
}
int inConvexPolygon(pt X, long double mnx, long double mxx, vector<pt>& P) {
  if (x(X) < mnx || x(X) > mxx) return -1;
  int lo = 1, hi = int(P.size()) - 1, mi;
  while (lo <= hi) {
    mi = (lo + hi) / 2;
    if (cross(P[mi] - P[0], X - P[0]) < -EPS) {
      lo = mi + 1;
    } else {
      hi = mi - 1;
    }
  }
  lo = hi;
  if (hi == -1) return -1;
  long double c = cross(X - P[lo], X - P[lo + 1]);
  if (same(c, 0.0)) return (segContains(X, P[lo], P[lo + 1]) ? 0 : -1);
  if (c > EPS) return -1;
  return 1;
}
int l, n, m, q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> l) {
    vector<pt> P1(l + 1);
    for (int i = 0; i < l; ++i) {
      cin >> P1[i];
    }
    cin >> n;
    vector<pt> P2(n + 1);
    for (int i = 0; i < n; ++i) {
      cin >> P2[i];
    }
    cin >> m;
    vector<pt> P3(m + 1);
    for (int i = 0; i < m; ++i) {
      cin >> P3[i];
    }
    P1[l] = P1[0];
    P2[n] = P2[0];
    P3[m] = P3[0];
    vector<pt> P = convexPolygonSum(P2, P3);
    P = convexPolygonSum(P1, P);
    long double mnx = x(P[0]);
    long double mxx = -oo;
    for (int i = 0; i < int(P.size()); ++i) {
      mxx = max(mxx, x(P[i]));
    }
    cin >> q;
    for (int i = 0; i < q; ++i) {
      pt cur;
      cin >> cur;
      cur = 3.0 * cur;
      if (inConvexPolygon(cur, mnx, mxx, P) >= 0) {
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    }
  }
  return 0;
}