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;
double pi = acos(-1);
int syn(double x) { return x < -1e-8 ? -1 : (x > 1e-8 ? 1 : 0); }
double Abs(double x) { return x * syn(x); }
struct P {
  double x, y;
  P(double _x = 0.0, double _y = 0.0) {
    x = _x;
    y = _y;
  }
  void print(char c) { cout << x << ' ' << y << c; }
};
struct L {
  P a, b;
  L(P _, P $) { a = _, b = $; }
  L(double ax = 0, double ay = 0, double bx = 0, double by = 0) {
    a = P(ax, ay);
    b = P(bx, by);
  }
};
struct C {
  P o;
  double r;
  C(P _o, double _r) {
    o = _o;
    r = _r;
  }
  C(double x = 0, double y = 0, double _r = 0) {
    o = P(x, y);
    r = _r;
  }
  C(P a, P b, P c) {
    double d =
        (((b.x * b.x + b.y * b.y) - (c.x * c.x + c.y * c.y)) * (a.y - b.y) -
         ((a.x * a.x + a.y * a.y) - (b.x * b.x + b.y * b.y)) * (b.y - c.y)) /
        ((a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y));
    double e = ((a.x * a.x + a.y * a.y) - (b.x * b.x + b.y * b.y) +
                d * (a.x - b.x)) /
               (b.y - a.y),
           f = -((a.x * a.x + a.y * a.y) + d * a.x + e * a.y);
    o = P(-d / 2., -e / 2.), r = sqrt((d * d + e * e) / 4 - f);
  }
};
bool operator==(P a, P b) { return syn(a.x - b.x) == 0 && syn(a.x - b.y) == 0; }
P operator+(P a, P b) { return P(a.x + b.x, a.y + b.y); }
P operator-(P a, P b) { return P(a.x - b.x, a.y - b.y); }
P operator*(P a, double b) { return P(a.x * b, a.y * b); }
P operator/(P a, double b) { return P(a.x / b, a.y / b); }
double operator*(P a, P b) { return a.x * b.y - a.y * b.x; }
double operator^(P a, P b) { return a.x * b.x + a.y * b.y; }
bool chk_rak(P p, P l, P r) { return syn((l - p) * (r - p)) < 0; }
bool operator<(const P &x, const P &y) {
  return (x.x == y.x) ? x.y < y.y : x.x < y.x;
}
bool operator<(const L &_, const L &$) {
  P x = _.b - _.a, y = $.b - $.a;
  int t1 = syn(x.y), t2 = syn(y.y);
  if (t1 ^ t2) {
    if (t1 == 0 && syn(x.x) < 0) return 1;
    if (t2 == 0 && syn(y.x) < 0) return 0;
    return t1 < t2;
  } else if (t1 == 0) {
    t1 = syn(x.x) ^ syn(y.x);
    return t1 == 0 ? ((chk_rak($.a, _.b, $.b))) : syn(x.x - y.x) < 0;
  } else {
    t1 = syn(y * x);
    return t1 == 0 ? ((chk_rak($.a, _.b, $.b))) : t1 < 0;
  }
}
double len(P a) { return sqrt(a ^ a); }
P turn(P a, double b) {
  return P(a.x * cos(b) - a.y * sin(b), a.x * sin(b) + a.y * cos(b));
}
P turn(P a, P b, double c) { return b + turn(a - b, c); }
double ang(P a) { return atan2(a.y, a.x); }
bool P_on_seg(P a, L b) {
  return !syn((a - b.a) * (b.b - b.a)) && syn((a - b.a) ^ (a - b.b)) <= 0;
}
bool P_on_ray(P a, L b) {
  return !syn((a - b.a) * (b.b - b.a)) && syn((a - b.a) ^ (b.b - b.a)) >= 0;
}
bool P_on_lin(P a, L b) { return !syn((a - b.a) * (b.b - b.a)); }
P FootPoint(P a, L b) {
  P x = a - b.a, y = a - b.b, z = b.b - b.a;
  double l1 = (x ^ z), l2 = -1.0 * (y ^ z);
  return b.a + z * (l1 / (l1 + l2));
}
P Sym_PL(P a, L b) { return 2 * FootPoint(a, b) - a; }
double P_to_seg(P a, L b) {
  P x = FootPoint(a, b);
  return (syn((a - b.a) ^ (a - b.b)) <= 0)
             ? len(a - x)
             : ((syn((a - b.a) ^ (b.b - b.a)) >= 0) ? len(b.b - a)
                                                    : len(b.a - a));
}
double P_to_ray(P a, L b) {
  P x = FootPoint(a, b);
  return (syn((a - b.a) ^ (b.b - b.a)) >= 0) ? len(a - x) : len(a - b.a);
}
double P_to_lin(P a, L b) { return len(a - FootPoint(a, b)); }
P Inter_LL(L a, L b) {
  P x = a.b - a.a, y = b.b - b.a, z = a.a - b.a;
  return a.a + x * ((y * z) / (x * y));
}
bool chk_Inter_LR(L a, L b) { return P_on_ray(Inter_LL(a, b), b); }
bool chk_Inter_LS(L a, L b) { return P_on_ray(Inter_LL(a, b), b); }
bool chk_Inter_RR(L a, L b) {
  P x = Inter_LL(a, b);
  return P_on_ray(x, a) && P_on_ray(x, b);
}
bool chk_Inter_RS(L a, L b) {
  P x = Inter_LL(a, b);
  return P_on_ray(x, a) && P_on_seg(x, b);
}
bool chk_Inter_SS(L a, L b) {
  if (max(a.a.y, a.b.y) < min(b.a.y, b.b.y) ||
      max(b.a.y, b.b.y) < min(a.a.y, a.b.y))
    return false;
  if (max(a.a.y, a.b.y) < min(b.a.y, b.b.y) ||
      max(b.a.y, b.b.y) < min(a.a.y, a.b.y))
    return false;
  return syn((a.b - a.a) * (b.a - a.a)) * syn((a.b - a.a) * (b.b - a.a)) < 0 &&
         syn((b.b - b.a) * (a.a - b.a)) * syn((b.b - b.a) * (a.b - b.a)) < 0;
}
double area(const vector<P> &p) {
  int n = p.size();
  double res = p[n - 1] * p[0];
  for (int i = 1; i < n; i++) res += p[i - 1] * p[i];
  return res / 2.0;
}
double peri(const vector<P> &p) {
  int n = p.size();
  double res = len(p[n - 1] - p[0]);
  for (int i = 1; i < n; i++) res += len(p[i - 1] - p[i]);
  return res;
}
int chk_P_in_Po(const vector<P> &p, P a) {
  int res = 0, n = p.size();
  for (int i = 0; i < n; i++) {
    int j = i + 1;
    if (j == n) j = 0;
    if (P_on_seg(a, L(p[i], p[j]))) return 2;
    if (syn(a.y - min(p[i].y, p[j].y)) >= 0 &&
        syn(a.y - max(p[i].y, p[j].y)) < 0)
      res +=
          syn(p[i].x + (a.y - p[i].y) / (p[j].y - p[i].y) * (p[j].x - p[i].x) -
              a.x) > 0;
  }
  return res & 1;
}
int chk_P_in_Co(const vector<P> &p, P a) {
  int n = p.size();
  if (chk_rak(p[0], p[1], a) || chk_rak(p[0], a, p[n - 1])) return 0;
  if (P_on_seg(a, L(p[0], p[1])) || P_on_seg(a, L(p[0], p[n - 1]))) return 2;
  int l = 1, r = n - 2, ans = 1;
  while (l <= r) {
    int mid = l + r >> 1;
    if (chk_rak(p[0], a, p[mid]))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  int x = syn((a - p[ans]) * (p[ans + 1] - p[ans]));
  if (x > 0)
    return 0;
  else if (x == 0)
    return 2;
  return 1;
}
bool chk_L_in_Po(const vector<P> &p, L a) {
  int n = p.size();
  for (int i = 0; i < n; i++) {
    int j = i + 1;
    if (j == n) j = 0;
    P x = Inter_LL(a, L(p[i], p[j]));
    if (!(x == a.a || x == a.b || (!chk_Inter_SS(a, L(p[i], p[j])))))
      return false;
  }
  return chk_P_in_Po(p, a.a) && chk_P_in_Po(p, a.b);
}
bool chk_L_in_Co(const vector<P> &p, L a) {
  return chk_P_in_Co(p, a.a) && chk_P_in_Co(p, a.b);
}
vector<P> Andrew(vector<P> p) {
  vector<P> res;
  sort(p.begin(), p.end());
  int n = p.size();
  for (int i = 0; i < n; i++) {
    while (res.size() > 1 && syn((res[res.size() - 1] - res[res.size() - 2]) *
                                 (p[i] - res[res.size() - 2])) <= 0)
      res.pop_back();
    res.push_back(p[i]);
  }
  int k = res.size();
  for (int i = n - 2; ~i; i--) {
    while (res.size() > k && syn((res[res.size() - 1] - res[res.size() - 2]) *
                                 (p[i] - res[res.size() - 2])) <= 0)
      res.pop_back();
    res.push_back(p[i]);
  }
  res.pop_back();
  return res;
}
bool chk_PP(const vector<P> &A, const vector<P> &B) {
  for (P x : A)
    if (chk_P_in_Po(B, x)) return 0;
  for (P x : B)
    if (chk_P_in_Po(A, x)) return 0;
  int n = A.size(), m = B.size();
  for (int i = 0; i < n; i++) {
    int j = i + 1;
    if (j == n) j = 0;
    for (int k = 0; k < m; k++) {
      int l = k + 1;
      if (l == m) l = 0;
      if (chk_Inter_SS(L(A[i], A[j]), L(B[k], B[l]))) return 0;
    }
  }
  return 1;
}
bool chk_con_PP(const vector<P> &A, const vector<P> &B) {
  for (P x : B)
    if (!chk_P_in_Po(A, x)) return 0;
  return 1;
}
double diameter(vector<P> p) {
  int n = p.size();
  p.emplace_back(p[0]);
  double ans = 0;
  int q = 1;
  for (int i = 0; i < n; i++) {
    while (((p[q] - p[i]) * (p[i + 1] - p[i])) >
           ((p[q + 1] - p[i]) * (p[i + 1] - p[i])))
      q = (q + 1) % n;
    ans = max(ans, max(len(p[q] - p[i]), len(p[q] - p[i + 1])));
  }
  return ans;
}
vector<L> HalfCutInter(vector<L> l) {
  int m = l.size(), n = 0;
  deque<L> q;
  sort(l.begin(), l.end());
  for (int i = 0; i < m; i++)
    if (i == 0 || syn((l[i - 1].b - l[i - 1].a) * (l[i].b - l[i].a)))
      l[n++] = l[i];
  int sz = 0;
  for (int i = 0; i < n; i++) {
    while (sz > 1 && chk_rak(l[i].a, l[i].b, Inter_LL(q[sz - 1], q[sz - 2])))
      q.pop_back(), sz--;
    while (sz > 1 && chk_rak(l[i].a, l[i].b, Inter_LL(q[0], q[1])))
      q.pop_front(), sz--;
    q.push_back(l[i]);
    sz++;
  }
  while (sz > 1 && chk_rak(q[0].a, q[0].b, Inter_LL(q[sz - 1], q[sz - 2])))
    q.pop_back(), sz--;
  while (sz > 1 && chk_rak(q[sz - 1].a, q[sz - 1].b, Inter_LL(q[0], q[1])))
    q.pop_front(), sz--;
  return vector<L>(q.begin(), q.end());
}
vector<P> toPolygon(vector<L> x) {
  int n = x.size();
  vector<P> res(n);
  for (int i = 0; i < n; i++) res[i] = Inter_LL(x[i], x[(i + 1) % n]);
  return res;
}
vector<L> toHalfCut(vector<P> x) {
  int n = x.size();
  vector<L> res(n);
  for (int i = 0; i < n; i++) res[i] = L(x[i], x[(i + 1) % n]);
  return res;
}
vector<P> Mincowski(vector<P> x, vector<P> y) {
  int n = x.size(), m = y.size();
  deque<P> v1(n), v2(m);
  vector<P> res;
  for (int i = 0; i < n; i++) v1[i] = x[(i + 1) % n] - x[i];
  for (int i = 0; i < m; i++) v2[i] = y[(i + 1) % m] - y[i];
  res.push_back(x[0] + y[0]);
  int i = 0, j = 0;
  while (i < n && j < m)
    res.push_back(res[res.size() - 1] +
                  ((syn(v1[i] * v2[j]) > 0) ? v1[i++] : v2[j++]));
  while (i < n) res.push_back(res[res.size() - 1] + v1[i++]);
  while (j < m) res.push_back(res[res.size() - 1] + v2[j++]);
  return Andrew(res);
}
int n;
vector<P> A, B, C;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(0);
  cin >> n;
  for (double x, y; n--;) cin >> x >> y, A.push_back(P(x, y));
  cin >> n;
  for (double x, y; n--;) cin >> x >> y, B.push_back(P(x, y));
  cin >> n;
  for (double x, y; n--;) cin >> x >> y, C.push_back(P(x, y));
  A = Mincowski(Andrew(A), Mincowski(Andrew(B), Andrew(C)));
  cin >> n;
  for (double x, y; n--;)
    cin >> x >> y, puts(chk_P_in_Co(A, P(x, y) * 3) ? "YES" : "NO");
}