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;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename C>
ostream& operator<<(ostream& os, const vector<C>& v) {
  for (__typeof((v).begin()) __it = (v).begin(); __it != (v).end(); __it++)
    os << *(__it) << ' ';
  return os;
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-5;
template <class T>
struct Point {
  T x, y;
  Point() : x(0), y(0) {}
  Point(T a, T b) : x(a), y(b) {}
  bool half() const { return y < 0 || (y == 0 && x < 0); }
  T scal(const Point& other) const { return x * other.x + y * other.y; }
  T vect(const Point& other) const { return x * other.y - y * other.x; }
  bool operator<(const Point& other) const {
    bool ah = half();
    bool bh = other.half();
    if (ah ^ bh) return ah < bh;
    return vect(other) > 0;
  }
  Point operator-(const Point& other) const {
    return Point(x - other.x, y - other.y);
  }
  Point operator+(const Point& other) const {
    return Point(other.x + x, other.y + y);
  }
};
ostream& operator<<(ostream& os, const Point<long long>& p) {
  return os << p.x << ' ' << p.y;
}
long long getS(const Point<long long>& a, const Point<long long>& b,
               const Point<long long>& c) {
  return a.vect(b) + b.vect(c) + c.vect(a);
}
long long mabs(long long a) { return a < 0 ? -a : a; }
const int maxn = 100500;
Point<long long> ps[3][maxn];
Point<long long> down[3];
Point<long long> vs[3 * maxn];
Point<long long> res[3 * maxn];
int main() {
  int last = 0;
  for (int i = 0; i < 3; i++) {
    int n;
    cin >> n;
    for (int j = 0; j < n; j++) cin >> ps[i][j].x >> ps[i][j].y;
    ps[i][n] = ps[i][0];
    down[i] = ps[i][0];
    for (int j = 1; j <= n; j++) {
      vs[last++] = Point<long long>(ps[i][j] - ps[i][j - 1]);
      if (ps[i][j].y < down[i].y ||
          (ps[i][j].y == down[i].y && ps[i][j].x < down[i].x))
        down[i] = ps[i][j];
    }
  }
  sort(vs, vs + last);
  Point<long long> start = down[0] + down[1] + down[2];
  {
    cerr << "start"
         << " = " << (start) << endl;
  };
  res[0] = Point<long long>(0, 0);
  int lastp = 1;
  for (int i = 0; i < last; i++) {
    if (i && vs[i].vect(vs[i - 1]) == 0)
      res[lastp - 1] = res[lastp - 1] + vs[i];
    else {
      res[lastp] = res[lastp - 1] + vs[i];
      lastp++;
    }
  }
  int T;
  cin >> T;
  while (T--) {
    int x, y;
    cin >> x >> y;
    Point<long long> p(x * 3, y * 3);
    p = p - start;
    int left = 0, right = lastp;
    while (right - left > 1) {
      int mid = (left + right) / 2;
      if (p < res[mid])
        right = mid;
      else if (res[mid + 1] < p && mid + 1 < lastp)
        left = mid;
      else {
        left = mid;
        right = mid + 1;
        break;
      }
    }
    long long ss = getS(res[left], res[right], p);
    if (ss > 0 ||
        (ss == 0 && (mabs(res[right].x - p.x) + mabs(p.x - res[left].x) ==
                         mabs(res[right].x - res[left].x) &&
                     mabs(res[right].y - p.y) + mabs(p.y - res[left].y) ==
                         mabs(res[right].y - res[left].y))))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}