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 {
  long long x, y;
  Point() {
    x = 0;
    y = 0;
  }
  Point(int xx, int yy) {
    x = xx;
    y = yy;
  }
  bool operator==(Point p1) { return x == p1.x && y == p1.y; }
  bool operator!=(Point p1) { return (x != p1.x || y != p1.y); }
  Point operator-(const Point p1) { return Point(x - p1.x, y - p1.y); }
  Point operator+(const Point p1) { return Point(x + p1.x, y + p1.y); }
  long long len() { return (x * x + y * y); }
  long long vec(Point p) { return (x * p.y - y * p.x); }
  void Print() { cout << x << ' ' << y << '\n'; }
  void Scan() { cin >> x >> y; }
};
Point M[4];
vector<Point> v;
vector<Point> mink;
bool cmp(Point p1, Point p2) {
  bool val1 = p1.y > 0 || (p1.y == 0 && p1.x > 0);
  bool val2 = p2.y > 0 || (p2.y == 0 && p2.x > 0);
  if (val1 != val2) return val1;
  return (p1.vec(p2) > 0);
}
bool cmp1(Point p1, Point p2) {
  long long v = p1.vec(p2);
  if (v > 0) return 1;
  if (v < 0) return 0;
  return p1.len() < p2.len();
}
int main() {
  for (int q = 1; q <= 3; q++) {
    int n;
    cin >> n;
    M[q] = Point(1e18, 1e18);
    vector<Point> v1;
    for (int i = 1; i <= n; i++) {
      int x, y;
      cin >> x >> y;
      v1.push_back(Point(x, y));
      if (y < M[q].y || (y == M[q].y && x < M[q].x)) {
        M[q] = Point(x, y);
      }
    }
    for (int i = 0; i < (int)v1.size(); i++) {
      v1[i] = v1[i] - M[q];
    }
    for (int i = 0; i < n; i++) {
      mink.push_back(v1[(i + 1) % n] - v1[i]);
    }
  }
  Point T = M[1] + M[2] + M[3];
  sort(mink.begin(), mink.end(), cmp);
  v.push_back(Point(0, 0));
  for (int i = 0; i + 1 < (int)mink.size(); i++) {
    v.push_back(v.back() + mink[i]);
  }
  int n1;
  n1 = v.size();
  Point M1 = Point(1e18, 1e18);
  vector<Point> vec;
  vector<Point> vec1;
  for (int i = 0; i < n1; i++) {
    int x, y;
    x = v[i].x;
    y = v[i].y;
    vec1.push_back(Point(x, y));
    if (y < M1.y || (y == M1.y && x < M1.x)) {
      M1 = Point(x, y);
    }
  }
  for (int i = 0; i < (int)vec1.size(); i++) {
    vec1[i] = vec1[i] - M1;
  }
  sort(vec1.begin(), vec1.end(), cmp1);
  for (int i = 0; i < (int)vec1.size(); i++) {
    if (i == 0 || vec1[i] != vec1[i - 1]) {
      vec.push_back(vec1[i]);
    }
  }
  vec.push_back({0, 0});
  int it = 0;
  vector<Point> con;
  for (int i = 0; i < (int)vec.size(); i++) {
    Point A = vec[i];
    int sz = con.size();
    if (sz <= 1) {
      con.push_back(A);
      continue;
    }
    Point B = con[sz - 1];
    Point C = con[sz - 2];
    B = B - C;
    A = A - C;
    while (B.vec(A) < 0 || (B.vec(A) == 0 && B.len() < A.len())) {
      con.pop_back();
      sz = con.size();
      if (sz <= 1) break;
      A = v[i];
      B = con[sz - 1];
      C = con[sz - 2];
      B = B - C;
      A = A - C;
    }
    con.push_back(vec[i]);
  }
  con.pop_back();
  int m;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    Point A;
    A.Scan();
    A.x = A.x * 3;
    A.y = A.y * 3;
    A = A - T;
    A = A - M1;
    if (con[1].vec(A) < 0 || con.back().vec(A) > 0) {
      cout << "NO\n";
      continue;
    }
    int l = 0, r = con.size();
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (con[mid].vec(A) <= 0) {
        r = mid;
      } else {
        l = mid;
      }
    }
    if (r == con.size()) {
      r--;
      l--;
    }
    if (l == 0) {
      r++;
      l++;
    }
    Point B = con[l];
    Point C = con[r];
    Point T = Point(0, 0);
    A = A - C;
    B = B - C;
    T = T - C;
    long long vec1 = B.vec(A);
    long long vec2 = B.vec(T);
    if (vec1 == 0) {
      cout << "YES\n";
      continue;
    }
    if ((vec1 < 0 && vec2 < 0) || (vec1 > 0 && vec2 > 0)) {
      cout << "YES\n";
      continue;
    }
    cout << "NO\n";
  }
}