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 std::abs;
using std::cin;
using std::cout;
using std::max;
using std::pair;
using std::sqrt;
using std::string;
using std::vector;
const int N = 200005;
inline int sgn(long double first) {
  return first > (1e-6) ? 1 : first < -(1e-6) ? -1 : 0;
}
inline bool eq(long double a, long double b) { return abs(a - b) < (1e-6); }
inline long double sqr(long double first) { return first * first; }
inline bool le(long double a, long double b) { return a < b + (1e-6); }
inline bool ge(long double a, long double b) { return a > b - (1e-6); }
const long double Pi = acos(-1.0);
inline int nxt(int first, int len) { return first == len - 1 ? 0 : first + 1; }
inline int nxt1(int first, int len) { return first == len ? 1 : first + 1; }
namespace Vector {
inline void print(const pair<long double, long double> &a, int first = 6) {
  printf("%.*lf %.*lf\n", first, (double)a.first, first, (double)a.second);
}
inline pair<long double, long double> add(
    const pair<long double, long double> &a,
    const pair<long double, long double> &b) {
  return std::make_pair(a.first + b.first, a.second + b.second);
}
inline pair<long double, long double> dec(
    const pair<long double, long double> &a,
    const pair<long double, long double> &b) {
  return std::make_pair(a.first - b.first, a.second - b.second);
}
inline long double cross(const pair<long double, long double> &a,
                         const pair<long double, long double> &b) {
  return a.first * b.second - b.first * a.second;
}
inline long double pmul(const pair<long double, long double> &a,
                        const pair<long double, long double> &b) {
  return a.first * b.first + a.second * b.second;
}
inline long double len2(const pair<long double, long double> &a) {
  return a.first * a.first + a.second * a.second;
}
inline long double len(const pair<long double, long double> &a) {
  return sqrt(len2(a));
}
pair<long double, long double> operator+(
    const pair<long double, long double> &a,
    const pair<long double, long double> &b) {
  return add(a, b);
}
pair<long double, long double> operator-(
    const pair<long double, long double> &a,
    const pair<long double, long double> &b) {
  return dec(a, b);
}
long double operator*(const pair<long double, long double> &a,
                      const pair<long double, long double> &b) {
  return cross(a, b);
}
pair<long double, long double> operator*(
    const pair<long double, long double> &a, const long double &first) {
  return std::make_pair(a.first * first, a.second * first);
}
pair<long double, long double> operator/(
    const pair<long double, long double> &a, const long double &first) {
  return std::make_pair(a.first / first, a.second / first);
}
inline int chkdir(const pair<long double, long double> &a,
                  const pair<long double, long double> &b) {
  return sgn(a * b) == 0;
}
inline long double angcos(const pair<long double, long double> &a,
                          const pair<long double, long double> &b) {
  return pmul(a, b) / (len(a) * len(b));
}
inline long double angsin(const pair<long double, long double> &a,
                          const pair<long double, long double> &b) {
  return a * b / (len(a) * len(b));
}
inline long double incline(const pair<long double, long double> &a) {
  return atan2(a.second, a.first);
}
inline pair<long double, long double> rotate(
    const pair<long double, long double> &a, long double first) {
  return std::make_pair(a.first * cos(first) - a.second * sin(first),
                        a.first * sin(first) + a.second * cos(first));
}
inline pair<long double, long double> rotate90(
    const pair<long double, long double> &a) {
  return std::make_pair(-a.second, a.first);
}
inline long double dis(const pair<long double, long double> &a,
                       const pair<long double, long double> &b) {
  return len(b - a);
}
inline long double dis2(const pair<long double, long double> &a,
                        const pair<long double, long double> &b) {
  return len2(b - a);
}
}  // namespace Vector
using namespace Vector;
namespace Line {
struct line {
  pair<long double, long double> s, t;
};
inline void print(const line &a, int first = 6) {
  printf("%.*lf %.*lf -> %.*lf %.*lf\n", first, (double)a.s.first, first,
         (double)a.s.second, first, (double)a.t.first, first,
         (double)a.t.second);
}
inline pair<long double, long double> tovec(const line &a) { return a.t - a.s; }
inline long double maxx(const line &a) {
  return std::max(a.s.first, a.t.first);
}
inline long double minx(const line &a) {
  return std::min(a.s.first, a.t.first);
}
inline long double maxy(const line &a) {
  return std::max(a.s.second, a.t.second);
}
inline long double miny(const line &a) {
  return std::min(a.s.second, a.t.second);
}
inline long double incline(const line &a) { return Vector::incline(tovec(a)); }
inline pair<long double, long double> inter(const line &a, const line &b) {
  long double s1 = (b.s - a.s) * (a.t - a.s), s2 = (a.t - a.s) * (b.t - a.s);
  long double s = s1 + s2;
  s1 /= s, s2 /= s;
  return b.s * s2 + b.t * s1;
}
inline int chkdir(const line &a, const line &b) {
  return Vector::chkdir(tovec(a), tovec(b));
}
inline int chkside(const pair<long double, long double> &a, const line &b) {
  return sgn(tovec(b) * (a - b.s));
}
inline int on(const pair<long double, long double> &a, const line &b) {
  int ret = 0;
  ret |= (sgn((a - b.s) * tovec(b)) == 0);
  if (a.first < minx(b) - (1e-6) || a.first > maxx(b) + (1e-6) ||
      a.second < miny(b) - (1e-6) || a.second > maxy(b) + (1e-6))
    ret |= 2;
  return ret;
}
inline int chkinter(const line &a, const line &b) {
  if (maxx(a) < minx(b) || maxx(b) < minx(a) || maxy(a) < miny(b) ||
      maxy(b) < miny(a))
    return 0;
  if (abs(tovec(a) * tovec(b)) < (1e-6)) return 2;
  pair<long double, long double> va = tovec(a), vb = tovec(b);
  return sgn((a.s - b.s) * vb) != sgn((a.t - b.s) * vb) &&
         sgn((b.s - a.s) * va) != sgn((b.t - a.s) * va);
}
inline int chkrayinter(const line &a, const line &b) {
  if (abs(tovec(a) * tovec(b)) < (1e-6)) return 2;
  pair<long double, long double> va = tovec(a), vb = tovec(b);
  long double s1 = (a.s - b.s) * vb, s2 = (a.t - b.s) * vb;
  if (s1 < 0) s1 = -s1, s2 = -s2;
  return sgn((b.s - a.s) * va) != sgn((b.t - a.s) * va) && s1 > s2;
}
inline long double dis(const pair<long double, long double> &a, const line &b) {
  return abs((a - b.s) * tovec(b)) / len(tovec(b));
}
inline long double dis2(const pair<long double, long double> &a,
                        const line &b) {
  return sqr((a - b.s) * tovec(b)) / len2(tovec(b));
}
inline long double dis_seg(const pair<long double, long double> &a,
                           const line &b) {
  if (sgn(pmul((a - b.s), tovec(b))) == sgn(pmul(a - b.t, tovec(b)))) {
    return std::min(Vector::dis(a, b.s), Vector::dis(a, b.t));
  }
  return dis(a, b);
}
inline long double dis2_seg(const pair<long double, long double> &a,
                            const line &b) {
  if (sgn(pmul((a - b.s), tovec(b))) == sgn(pmul(a - b.t, tovec(b)))) {
    return std::min(Vector::dis2(a, b.s), Vector::dis2(a, b.t));
  }
  return dis2(a, b);
}
inline pair<long double, long double> foot(
    const pair<long double, long double> &a, const line &b) {
  long double s1 = pmul((a - b.s), tovec(b)), s2 = pmul((b.t - a), tovec(b));
  long double s = s1 + s2;
  s1 /= s, s2 /= s;
  return b.s * s2 + b.t * s1;
}
inline int foot_on(const pair<long double, long double> &a, const line &b) {
  return sgn(pmul((a - b.s), tovec(b))) != sgn(pmul(a - b.t, tovec(b)));
}
inline pair<long double, long double> symmetry(
    const pair<long double, long double> &a, const line &b) {
  pair<long double, long double> t = foot(a, b);
  return t * 2 - a;
}
}  // namespace Line
using namespace Line;
namespace Polygon {
long double area(const vector<pair<long double, long double> > &p) {
  if (p.size() <= 2) return 0;
  long double s = 0;
  for (int i = 0; i < p.size() - 1; ++i) s += p[i] * p[i + 1];
  s += (*p.rbegin()) * p[0];
  return abs(s) / 2;
}
long double parameter(const vector<pair<long double, long double> > &p) {
  if (p.size() <= 1) return 0;
  long double ret = 0;
  for (int i = 0; i < p.size() - 1; ++i) ret += len(p[i + 1] - p[i]);
  ret += len(p[0] - *p.rbegin());
  return ret;
}
int top;
pair<long double, long double> cv, stk[N];
bool cmp(const pair<long double, long double> &a,
         const pair<long double, long double> &b) {
  int s = sgn((a - cv) * (b - cv));
  return s == 0 ? a.first < b.first : s >= 0;
}
vector<pair<long double, long double> > convex(
    vector<pair<long double, long double> > p) {
  top = 0;
  int id = 0;
  cv = std::make_pair(1e9, 1e9);
  for (int i = 0; i < p.size(); ++i)
    if ((eq(cv.first, p[i].first) && p[i].second < cv.second) ||
        p[i].first < cv.first)
      cv = p[i], id = i;
  std::swap(p[0], p[id]);
  std::sort(p.begin() + 1, p.end(), cmp);
  stk[++top] = p[0];
  for (int i = 1; i < p.size(); ++i) {
    while (top > 1 &&
           sgn((p[i] - stk[top - 1]) * (stk[top] - stk[top - 1])) >= 0)
      --top;
    stk[++top] = p[i];
  }
  return vector<pair<long double, long double> >(stk + 1, stk + top + 1);
}
bool cmp1(const pair<long double, long double> &a,
          const pair<long double, long double> &b) {
  return eq(a.first, b.first) ? a.second < b.second : a.first < b.first;
}
vector<pair<long double, long double> > convex_andrew(
    vector<pair<long double, long double> > p) {
  std::sort(p.begin(), p.end(), cmp1);
  int top = 0;
  for (int i = 0; i < p.size(); ++i) {
    pair<long double, long double> first = p[i];
    while (top > 1 && chkside(stk[top], line{stk[top - 1], first}) >= 0) --top;
    stk[++top] = first;
  }
  vector<pair<long double, long double> > ret(stk + 1, stk + top + 1);
  top = 0;
  for (int i = p.size() - 1; ~i; --i) {
    pair<long double, long double> first = p[i];
    while (top > 1 && chkside(stk[top], line{stk[top - 1], first}) >= 0) --top;
    stk[++top] = first;
  }
  for (int i = 2; i < top; ++i) ret.push_back(stk[i]);
  return ret;
}
vector<pair<long double, long double> > mergeconvex(
    const vector<pair<long double, long double> > &a,
    const vector<pair<long double, long double> > &b) {
  int l = 0, r = 0;
  vector<pair<long double, long double> > ret;
  int n = a.size(), m = b.size();
  while (l < n && r < m) {
    ret.push_back(a[l] + b[r]);
    if ((sgn((a[nxt(l, n)] - a[l]) * (b[nxt(r, m)] - b[r])) >= 0))
      ++l;
    else
      ++r;
  }
  while (l < n) ret.push_back(a[l] + b[0]), ++l;
  while (r < m) ret.push_back(a[0] + b[r]), ++r;
  return ret;
}
int on(pair<long double, long double> t,
       const vector<pair<long double, long double> > &p) {
  for (int i = 0; i < p.size(); ++i) {
    int j = nxt(i, p.size());
    if (on(t, line{p[i], p[j]}) == 1) return 1;
  }
  return 0;
}
int in(pair<long double, long double> t,
       const vector<pair<long double, long double> > &p) {
  line l = line{t, t + std::make_pair(10, 3 * (1e-6))};
  int ok = 0;
  for (int i = 0; i < p.size() - 1; ++i)
    if (chkrayinter(l, line{p[i], p[i + 1]}) == 1) ++ok;
  if (chkrayinter(l, line{*p.rbegin(), p[0]}) == 1) ++ok;
  ok &= 1;
  return ok;
}
int in_ang(pair<long double, long double> t,
           const vector<pair<long double, long double> > &p) {
  int ok = 0;
  for (int i = 0; i < p.size(); ++i) {
    int j = nxt(i, p.size());
    int a = sgn(p[i].second - t.second), b = sgn(p[j].second - t.second);
    if (a != b) {
      if (sgn((p[i] - t) * (p[j] - t)) > 0) {
        if (a) ++ok;
        if (b) ++ok;
      } else {
        if (a) --ok;
        if (b) --ok;
      }
    }
  }
  return ok;
}
int in_ang(pair<long double, long double> t, pair<long double, long double> s,
           const vector<pair<long double, long double> > &p,
           const vector<long double> &a) {
  long double b = incline(t - s);
  int id = std::upper_bound(a.begin(), a.end(), b) - a.begin();
  if (!id && eq(b, a[0])) ++id;
  if (id == a.size() && eq(b, *a.rbegin())) --id;
  if (id == a.size() || id == 0) return 0;
  int state = chkside(t, line{p[id], p[nxt(id, p.size())]});
  if (state == 0) return on(t, line{p[id], p[nxt(id, p.size())]}) == 1;
  return state > 0;
}
inline long double diameter2(const vector<pair<long double, long double> > &p) {
  long double ans = 0;
  int n = p.size();
  if (n == 1) return 0;
  if (n == 2) return Vector::dis2(p[0], p[1]);
  for (int i = 0, j = 0; i < n; ++i) {
    while (chkside(p[nxt(j, n)], line{p[j], p[j] - (p[nxt(i, n)] - p[i])}) <= 0)
      j = nxt(j, n);
    ans = std::max(ans, std::max(dis2(p[i], p[j]), dis2(p[nxt(i, n)], p[j])));
  }
  return ans;
}
}  // namespace Polygon
using Polygon::area;
using Polygon::convex;
using Polygon::convex_andrew;
using Polygon::diameter2;
using Polygon::in;
using Polygon::in_ang;
using Polygon::mergeconvex;
using Polygon::on;
using Polygon::parameter;
namespace HalfPlaneIntersection {
int low, top;
pair<long double, long double> p[N];
line l[N], stk[N];
bool cmp(const line &a, const line &b) { return incline(a) < incline(b); }
inline int HPIS(int n, const line *rl, line *ret, bool tp = 0,
                pair<long double, long double> *rep = NULL) {
  std::copy(rl, rl + n + 1, l);
  int rt = 0;
  std::sort(l + 1, l + n + 1, cmp);
  for (int cl = 1, cr; cl <= n; cl = cr + 1) {
    cr = cl;
    while (cr < n && chkdir(l[cl], l[cr + 1])) ++cr;
    int id = cl;
    for (int i = cl; i <= cr; ++i)
      if (chkside(l[i].s, l[id]) > 0) id = i;
    l[++rt] = l[id];
  }
  low = 1, top = 0;
  for (int i = 1; i <= rt; ++i) {
    while (top > low && chkside(p[top], l[i]) < 0) --top;
    while (top > low && chkside(p[low + 1], l[i]) < 0) ++low;
    if (top >= low) p[top + 1] = inter(l[i], stk[top]);
    stk[++top] = l[i];
  }
  while (top > low && chkside(p[top], stk[low]) < 0) --top;
  p[low] = inter(stk[low], stk[top]);
  std::copy(stk + low, stk + top + 1, ret + 1);
  if (tp) std::copy(p + low, p + top + 1, rep + 1);
  return top - low + 1;
}
}  // namespace HalfPlaneIntersection
using HalfPlaneIntersection::HPIS;
namespace Circle {
struct cir {
  pair<long double, long double> o;
  long double r;
};
inline void print(const cir &c, int first = 6) {
  printf("o: %.*lf %.*lf r:%.*lf\n", first, (double)c.o.first, first,
         (double)c.o.second, first, (double)sqrt(c.r));
}
inline int in(const pair<long double, long double> &a, const cir &b) {
  return sgn(b.r - Vector::dis2(a, b.o));
}
inline cir getcir(const pair<long double, long double> &a,
                  const pair<long double, long double> &b,
                  const pair<long double, long double> &c) {
  pair<long double, long double> B = (a + b) / 2, C = (a + c) / 2;
  pair<long double, long double> o =
      inter(line{B, B + rotate90(b - a)}, line{C, C + rotate90(c - a)});
  return cir{o, Vector::dis2(o, a)};
}
inline cir mincover(vector<pair<long double, long double> > p) {
  int n = p.size();
  cir c = cir{p[0], 0};
  std::random_shuffle(p.begin(), p.end());
  for (int i = 0; i < n; ++i)
    if (in(p[i], c) == -1) {
      c = cir{p[i], 0};
      for (int j = 0; j < i; ++j)
        if (in(p[j], c) == -1) {
          c = cir{(p[i] + p[j]) / 2, dis2(p[i], p[j]) / 4};
          for (int k = 0; k < j; ++k)
            if (in(p[k], c) == -1) {
              c = getcir(p[i], p[j], p[k]);
            }
        }
    }
  return c;
}
}  // namespace Circle
using namespace Circle;
int n, m, t, q;
pair<long double, long double> s;
vector<pair<long double, long double> > a, b, c;
inline void proc(vector<pair<long double, long double> > &a) {
  int id = 0, top = 0;
  for (int i = 0; i < a.size(); ++i)
    if (a[i] < a[id]) id = i;
  std::rotate(a.begin(), a.begin() + id, a.end());
  while (a.size() > 1 &&
         eq(incline(a[a.size() - 1] - a[0]), incline(a[a.size() - 2] - a[0])))
    a.pop_back();
  int d = 0;
  while (d + 2 < a.size() &&
         eq(incline(a[d + 2] - a[0]), incline(a[d + 1] - a[0])))
    ++d;
  for (int i = 1; i + d < a.size(); ++i) std::swap(a[i], a[i + d]);
  a.resize(a.size() - d);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  cin >> m;
  b.resize(m);
  for (int i = 0; i < m; ++i) cin >> b[i].first >> b[i].second;
  cin >> t;
  c.resize(t);
  for (int i = 0; i < t; ++i) cin >> c[i].first >> c[i].second;
  proc(a), proc(b), proc(c);
  vector<pair<long double, long double> > d = mergeconvex(mergeconvex(a, b), c);
  proc(d);
  vector<long double> ang;
  s = *d.begin();
  for (int i = 1; i < d.size(); ++i) ang.push_back(incline(d[i] - s));
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    pair<long double, long double> t;
    cin >> t.first >> t.second;
    puts(in_ang(std::make_pair(t.first * 3, t.second * 3), s, d, ang) ? "YES"
                                                                      : "NO");
  }
  return 0;
}