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;
struct Point {
  double x, y;
  Point() : x(0), y(0) {}
  Point(double x, double y) : x(x), y(y) {}
  Point(const Point &p) : x(p.x), y(p.y) {}
  int operator<(const Point &rhs) const {
    return make_pair(y, x) < make_pair(rhs.y, rhs.x);
  }
  int operator==(const Point &rhs) const {
    return make_pair(y, x) == make_pair(rhs.y, rhs.x);
  }
  Point operator+(const Point &p) const { return Point(x + p.x, y + p.y); }
  Point operator-(const Point &p) const { return Point(x - p.x, y - p.y); }
  Point operator*(double c) const { return Point(x * c, y * c); }
  Point operator/(double c) const { return Point(x / c, y / c); }
  double arg() const { return atan2(y, x); }
};
double cross(Point p, Point q) { return p.x * q.y - p.y * q.x; }
double area(Point a, Point b, Point c) {
  return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;
}
double area2(Point a, Point b, Point c) {
  return cross(a, b) + cross(b, c) + cross(c, a);
}
double dot(Point p, Point q) { return p.x * q.x + p.y * q.y; }
double dist(Point p, Point q) { return sqrt(dot(p - q, p - q)); }
double dist2(Point p, Point q) { return dot(p - q, p - q); }
ostream &operator<<(ostream &os, const Point &p) {
  os << "(" << p.x << "," << p.y << ")";
  return os;
}
Point offset(vector<Point> &v) {
  Point ans = v[0];
  for (auto &p : v) {
    ans.x = min(ans.x, p.x);
    ans.y = min(ans.y, p.y);
  }
  return ans;
}
void diff(vector<Point> &v, vector<pair<double, Point>> &ret) {
  for (int i = 0; i < v.size(); ++i) {
    Point vec = v[(i + 1) % v.size()] - v[i];
    ret.emplace_back(vec.arg(), vec);
  }
}
vector<Point> minkowskisum(vector<Point> &a, vector<Point> &b) {
  Point off = offset(a) + offset(b);
  vector<pair<double, Point>> v;
  vector<Point> ret;
  diff(a, v);
  diff(b, v);
  sort(v.begin(), v.end(),
       [&](const pair<double, Point> &x, const pair<double, Point> &y) {
         return x.first < y.first;
       });
  vector<bool> mark(v.size(), false);
  for (int i = v.size() - 1; i > 0; --i) {
    if (abs(v[i].first - v[i - 1].first) < 1e-9) {
      mark[i] = true;
      v[i - 1].second = v[i - 1].second + v[i].second;
      v[i].second = Point(0, 0);
    }
  }
  for (int i = 0; i < v.size(); ++i)
    if (!mark[i]) ret.emplace_back(v[i].second);
  partial_sum(ret.begin(), ret.end(), ret.begin());
  off = off - offset(ret);
  for (auto &p : ret) p = p + off;
  return ret;
}
double cross(Point a, Point b, Point c) {
  return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}
bool PointInsidePolygon(vector<Point> &poly, Point q) {
  int a = 1, b = poly.size() - 1;
  swap(a, b);
  if (cross(poly[0], poly[a], q) > 0 || cross(poly[0], poly[b], q) < 0)
    return 0;
  while (abs(a - b) > 1) {
    int c = (a + b) >> 1;
    if (cross(poly[0], poly[c], q) > 0) {
      b = c;
    } else
      a = c;
  }
  return cross(poly[a], poly[b], q) <= 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<Point> a[3];
  for (int i = 0; i < 3; ++i) {
    int m;
    cin >> m;
    while (m--) {
      int x, y;
      cin >> x >> y;
      a[i].emplace_back(x, y);
    }
  }
  vector<Point> poly = minkowskisum(a[0], a[1]);
  poly = minkowskisum(poly, a[2]);
  int q;
  cin >> q;
  while (q--) {
    Point a;
    cin >> a.x >> a.y;
    a.x *= 3;
    a.y *= 3;
    if (PointInsidePolygon(poly, a))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}