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 double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int maxn = 1000000 + 5;
struct Point {
  long long x, y;
};
bool operator<(const Point &a, const Point &b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
class Convex {
 public:
  int n;
  Point p[maxn];
  void readin() {
    scanf("%d", &n);
    int x, y;
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &x, &y);
      p[i].x = x;
      p[i].y = y;
    }
  }
};
Convex p1, p2, p3;
int pk[maxn];
int m, size;
Point pts[maxn];
pair<pair<long long, long long>, int> q[maxn];
bool R[maxn];
Point add(Point a, Point b) {
  Point c;
  c.x = a.x + b.x;
  c.y = a.y + b.y;
  return c;
}
void add_points(Convex &a, Convex &b) {
  int k = 0;
  for (int i = 0; i < a.n; i++) {
    Point src = a.p[i];
    Point dest = a.p[(i + 1) % a.n];
    long long gx = src.y - dest.y;
    long long gy = -(src.x - dest.x);
    if (i == 0) {
      long long best = -1;
      int bestk = -1;
      for (int k = 0; k < b.n; k++) {
        long long current = gx * b.p[k].x + gy * b.p[k].y;
        if (k == 0 || current < best) best = current, bestk = k;
      }
      k = bestk;
    }
    while (1) {
      long long current = gx * b.p[k].x + gy * b.p[k].y;
      int k2 = (k + 1) % b.n;
      long long next = gx * b.p[k2].x + gy * b.p[k2].y;
      if (next < current)
        k = k2;
      else
        break;
    }
    pk[i] = k;
  }
  for (int i = 0; i < a.n; i++) {
    int src = pk[(i + a.n - 1) % a.n];
    int dest = pk[i];
    pts[size++] = add(a.p[i], b.p[(src + b.n - 1) % b.n]);
    pts[size++] = add(a.p[i], b.p[(dest + 1) % b.n]);
    for (int k = src; k != dest; k = (k + 1) % b.n)
      pts[size++] = add(a.p[i], b.p[k]);
    pts[size++] = add(a.p[i], b.p[dest]);
  }
}
long long cross(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}
void merge_convex(Convex &a, Convex &b, Convex &c) {
  size = 0;
  add_points(a, b);
  add_points(b, a);
  sort(pts, pts + size);
  c.n = 0;
  for (int i = 0; i < size; i++) {
    for (; c.n >= 2 && cross(c.p[c.n - 2], c.p[c.n - 1], pts[i]) <= 0; c.n--)
      ;
    c.p[c.n++] = pts[i];
  }
  int tm = c.n;
  for (int i = size - 1; i >= 0; i--) {
    for (; c.n >= tm + 1 && cross(c.p[c.n - 2], c.p[c.n - 1], pts[i]) <= 0;
         c.n--)
      ;
    c.p[c.n++] = pts[i];
  }
  c.n--;
}
int main() {
  p1.readin();
  p2.readin();
  merge_convex(p1, p2, p3);
  p2.readin();
  merge_convex(p2, p3, p1);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    q[i] = make_pair(make_pair((long long)x * 3, (long long)y * 3), i);
  }
  sort(q, q + m);
  int k_min = 0, k_max = 0;
  for (int i = 0; i < p1.n; i++) {
    if (p1.p[i].x < p1.p[k_min].x) k_min = i;
    if (p1.p[i].x > p1.p[k_max].x) k_max = i;
  }
  for (int i = 0; i < m; i++) R[i] = false;
  int k1 = k_min, k2 = k_min;
  long long min_x = p1.p[k_min].x;
  long long max_x = p1.p[k_max].x;
  for (; p1.p[(k2 + p1.n - 1) % p1.n].x == min_x; k2 = (k2 + p1.n - 1) % p1.n)
    ;
  for (int i = 0; i < m; i++)
    if (q[i].first.first == min_x)
      R[q[i].second] =
          (q[i].first.second >= p1.p[k1].y && q[i].first.second <= p1.p[k2].y);
    else if (q[i].first.first > min_x && q[i].first.first < max_x) {
      for (; p1.p[(k2 + p1.n - 1) % p1.n].x <= q[i].first.first;
           k2 = (k2 + p1.n - 1) % p1.n)
        ;
      for (; p1.p[(k1 + 1) % p1.n].x <= q[i].first.first; k1 = (k1 + 1) % p1.n)
        ;
      Point key;
      key.x = q[i].first.first;
      key.y = q[i].first.second;
      R[q[i].second] =
          cross(p1.p[k2], p1.p[(k2 + p1.n - 1) % p1.n], key) <= 0 &&
          cross(p1.p[k1], p1.p[(k1 + 1) % p1.n], key) >= 0;
    } else if (q[i].first.first == max_x) {
      for (; p1.p[k2].x != max_x; k2 = (k2 + p1.n - 1) % p1.n)
        ;
      for (; p1.p[k1].x != max_x; k1 = (k1 + 1) % p1.n)
        ;
      R[q[i].second] =
          (q[i].first.second >= p1.p[k1].y && q[i].first.second <= p1.p[k2].y);
    }
  for (int i = 0; i < m; i++)
    if (R[i])
      printf("YES\n");
    else
      printf("NO\n");
  return 0;
}