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;
long long Min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long Max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long mut(long long val) {
  if (val < 0) return -val;
  return val;
}
struct pt {
  long long x, y;
  pt() { this->x = this->y = 0; }
  pt(long long x, long long y) {
    this->x = x;
    this->y = y;
  }
  pt operator+(const pt &p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt &p) const { return pt(x - p.x, y - p.y); }
  long long cross(const pt &p) const { return x * 1LL * p.y - y * 1LL * p.x; }
  long long cross(const pt &a, const pt &b) {
    return (a - *this).cross(b - *this);
  }
};
bool cmp(pt a, pt b) {
  if (a.y != b.y) return a.y < b.y;
  return a.x < b.x;
}
int n;
vector<pt> A, B;
int sgn(long long val) {
  if (val < 0) return -1;
  if (val > 0) return 1;
  return 0;
}
int ccw(pt p, pt q, pt r) { return sgn((q - p).cross(r - p)); }
vector<pt> convexhull(vector<pt> P) {
  sort(P.begin(), P.end(), cmp);
  vector<pt> ch;
  for (int i = 0; i < P.size(); i++) {
    while (ch.size() >= 2 && ccw(ch[ch.size() - 2], ch.back(), P[i]) <= 0)
      ch.pop_back();
    ch.push_back(P[i]);
  }
  int pivot_size = ch.size();
  for (int i = P.size() - 2; i >= 0; i--) {
    while (ch.size() > pivot_size &&
           ccw(ch[ch.size() - 2], ch.back(), P[i]) <= 0)
      ch.pop_back();
    ch.push_back(P[i]);
  }
  return ch;
}
void reorder_polygon(vector<pt> &P) {
  int pos = 0;
  for (int i = 1; i < P.size(); i++) {
    if (P[i].y < P[pos].y || (P[i].y == P[pos].y && P[i].x < P[pos].x)) {
      pos = i;
    }
  }
  rotate(P.begin(), P.begin() + pos, P.end());
}
vector<pt> merge(vector<pt> P, vector<pt> Q) {
  reorder_polygon(P);
  reorder_polygon(Q);
  P.push_back(P[0]);
  P.push_back(P[1]);
  Q.push_back(Q[0]);
  Q.push_back(Q[1]);
  vector<pt> result;
  int i = 0, j = 0;
  while (i < P.size() - 2 || j < Q.size() - 2) {
    result.push_back(P[i] + Q[j]);
    long long cross = (P[i + 1] - P[i]).cross(Q[j + 1] - Q[j]);
    if (cross >= 0) i++;
    if (cross <= 0) j++;
  }
  return result;
}
int inLineSegment(pt p, pt q, pt r) {
  if ((q - p).cross(r - p) != 0) return false;
  return Min(p.x, r.x) <= q.x && q.x <= Max(p.x, r.x) && Min(p.y, r.y) <= q.y &&
         q.y <= Max(p.y, r.y);
}
bool pointInTriangle(pt a, pt b, pt c, pt p) {
  long long s1 = mut(a.cross(b, c));
  long long s2 = mut(p.cross(a, b)) + mut(p.cross(b, c)) + mut(p.cross(c, a));
  return s1 == s2;
}
int testInPolygon(pt p) {
  if (p.y < A[0].y || (p.y == A[0].y && p.x < A[0].x)) return false;
  if (inLineSegment(A[0], p, A[A.size() - 2])) return true;
  int l = 1, r = A.size() - 3;
  while (l < r) {
    int m = (l + r) / 2;
    if (ccw(A[0], A[m + 1], p) >= 0) {
      l = m + 1;
    } else {
      r = m;
    }
  }
  if (inLineSegment(A[0], p, A[l]) || inLineSegment(A[l], p, A[l + 1]) ||
      inLineSegment(A[l + 1], p, A[0])) {
    return true;
  }
  return ccw(A[0], A[l], p) > 0 && ccw(A[l], A[l + 1], p) > 0 &&
         ccw(A[l + 1], A[0], p) > 0;
}
void solveQueries() {
  set<pair<long long, long long> > S;
  for (pt p : A) {
    S.insert(make_pair(p.x, p.y));
  }
  int q;
  pt p;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%lld%lld", &p.x, &p.y);
    p.x = p.x * 1LL * 3;
    p.y = p.y * 1LL * 3;
    if (S.find(make_pair(p.x, p.y)) != S.end() || testInPolygon(p)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pt p;
    scanf("%lld%lld", &p.x, &p.y);
    A.push_back(p);
  }
  A = convexhull(A);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pt p;
    scanf("%lld%lld", &p.x, &p.y);
    B.push_back(p);
  }
  B = convexhull(B);
  A = merge(A, B);
  A = convexhull(A);
  B.clear();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pt p;
    scanf("%lld%lld", &p.x, &p.y);
    B.push_back(p);
  }
  B = convexhull(B);
  A = merge(A, B);
  A = convexhull(A);
  solveQueries();
  return 0;
}