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);
template <typename T>
struct Point {
  T x, y;
  Point(T _x = 0, T _y = 0) : x(_x), y(_y) {}
  void swap() { swap(x, y); }
  double len() const;
  Point<double> asDouble() { return Point<double>(x, y); }
  Point<T> norm() const;
  Point<T> ort() const { return Point<T>(y, -x); }
  int side() const {
    if (x == 0)
      if (y < 0)
        return 3;
      else
        return 1;
    else if (x > 0)
      return 0;
    else
      return 2;
  }
};
template <typename T>
Point<T> operator-(const Point<T> &a) {
  return Point<T>(-a.x, -a.y);
}
template <typename T>
Point<T> operator+(const Point<T> &a, const Point<T> &b) {
  return Point<T>(a.x + b.x, a.y + b.y);
}
template <typename T>
Point<T> operator-(const Point<T> &a, const Point<T> &b) {
  return Point<T>(a.x - b.x, a.y - b.y);
}
template <typename T>
Point<T> operator*(const T a, const Point<T> &b) {
  return Point<T>(a * b.x, a * b.y);
}
template <typename T>
Point<T> operator*(const Point<T> &b, const T a) {
  return Point<T>(a * b.x, a * b.y);
}
template <typename T>
Point<T> operator/(const Point<T> &b, const T a) {
  return Point<T>(b.x / a, b.y / a);
}
template <typename T>
T operator*(const Point<T> &a, const Point<T> &b) {
  return a.x * b.x + a.y * b.y;
}
template <typename T>
T operator^(const Point<T> &a, const Point<T> &b) {
  return a.x * b.y - a.y * b.x;
}
template <typename T>
double Point<T>::len() const {
  return sqrt((double)((*this) * (*this)));
}
template <typename T>
Point<T> Point<T>::norm() const {
  return (*this) / len();
}
template <typename T>
bool operator<(const Point<T> &a, const Point<T> &b) {
  return a.x < b.x || a.x == b.x && a.y < b.y;
}
bool operator==(const Point<int> &a, const Point<int> &b) {
  return a.x == b.x && a.y == b.y;
}
bool operator!=(const Point<int> &a, const Point<int> &b) {
  return a.x != b.x || a.y != b.y;
}
int sign(int x) {
  if (x == 0) return 0;
  if (x > 0)
    return +1;
  else
    return -1;
}
int sign(long long x) {
  if (x == 0) return 0;
  if (x > 0)
    return +1;
  else
    return -1;
}
int sign(double x) {
  if (fabs(x) < 1.0e-11) return 0;
  if (x > 0)
    return +1;
  else
    return -1;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
const Point<double> INFDPnt(1.0e30, 1.0e30);
vector<Point<long long> > a[3];
bool cmp(const Point<long long> &p1, const Point<long long> &p2) {
  int s1 = p1.side();
  int s2 = p2.side();
  if (s1 != s2) return s1 < s2;
  return (p1 ^ p2) > 0;
}
vector<Point<long long> > add(const vector<Point<long long> > &a,
                              const vector<Point<long long> > &b) {
  vector<Point<long long> > d;
  for (int i = 0, _n = ((int)(a).size()); i < _n; i++)
    d.push_back(a[(i + 1) % (int)(a).size()] - a[i]);
  for (int i = 0, _n = ((int)(b).size()); i < _n; i++)
    d.push_back(b[(i + 1) % (int)(b).size()] - b[i]);
  sort((d).begin(), (d).end(), cmp);
  vector<Point<long long> > res;
  res.push_back(Point<long long>(0, 0));
  for (int i = 0, _n = ((int)(d).size() - 1); i < _n; i++)
    res.push_back(res.back() + d[i]);
  Point<long long> shift = *min_element((a).begin(), (a).end()) +
                           *min_element((b).begin(), (b).end()) -
                           *min_element((res).begin(), (res).end());
  for (int i = 0, _n = ((int)(d).size()); i < _n; i++) res[i] = res[i] + shift;
  return res;
}
int signOnLine(Point<long long> a, Point<long long> b, Point<long long> p) {
  if (a.x == b.x)
    if (p.y > b.y)
      return +1;
    else if (p.y < a.y)
      return -1;
    else
      return 0;
  else
    return sign(p.y * (b.x - a.x) -
                ((p.x - a.x) * (b.y - a.y) + a.y * (b.x - a.x)));
}
struct Poly {
  set<Point<long long> > bottom, top;
  void read(vector<Point<long long> > a) {
    int n = (int)(a).size();
    a.push_back(a[0]);
    long long area = 0;
    top.clear();
    bottom.clear();
    for (int i = 0, _n = (n); i < _n; i++) {
      if (a[i].x < a[i + 1].x) {
        bottom.insert(a[i]);
        bottom.insert(a[i + 1]);
      }
      if (a[i].x > a[i + 1].x) {
        top.insert(a[i]);
        top.insert(a[i + 1]);
      }
      area += (a[i].y + a[i + 1].y) * (a[i].x - a[i + 1].x);
    }
    if (area < 0) {
      area = -area;
      top.swap(bottom);
    }
    if (n <= 2) {
      top.clear();
      top.insert(a[0]);
      top.insert(a[n - 1]);
      bottom = top;
    }
  }
  bool contains(Point<long long> p) {
    set<Point<long long> >::iterator it = top.end(), it1, it2, it1n, it2n;
    it--;
    if (p.x < top.begin()->x || p.x > it->x) return false;
    it1 = bottom.lower_bound(p);
    if (it1 == bottom.begin()) it1++;
    if (it1 == bottom.end()) it1--;
    it2 = top.lower_bound(p);
    if (it2 == top.begin()) it2++;
    if (it2 == top.end()) it2--;
    it1n = it1;
    it1--;
    it2n = it2;
    it2--;
    return signOnLine(*it1, *it1n, p) >= 0 && signOnLine(*it2, *it2n, p) <= 0;
  }
} poly;
int main() {
  for (int i = 0, _n = (3); i < _n; i++) {
    int n;
    scanf("%d", &n);
    for (int j = 0, _n = (n); j < _n; j++) {
      int x, y;
      scanf("%d%d", &x, &y);
      a[i].push_back(Point<long long>(x, y));
    }
  }
  vector<Point<long long> > b = add(a[0], a[1]);
  b = add(b, a[2]);
  poly.read(b);
  int n;
  scanf("%d", &n);
  for (int i = 0, _n = (n); i < _n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    printf("%s\n", poly.contains(Point<long long>(x, y) * 3LL) ? "YES" : "NO");
  }
  return 0;
}