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 long long N = 5000700;
template <typename T>
pair<T, T> operator-(pair<T, T> a, pair<T, T> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T>
pair<T, T> operator+(pair<T, T> a, pair<T, T> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
long long ans[N];
long long qx[N];
long long qy[N];
vector<long long> qrs;
bool to_left(const pair<long long, long long> &a,
             const pair<long long, long long> &b) {
  return a.second * b.first > a.first * b.second;
}
bool to_left_equal(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second * b.first >= a.first * b.second;
}
bool in_triangle(const pair<long long, long long> &x,
                 const pair<long long, long long> &a,
                 const pair<long long, long long> &b,
                 const pair<long long, long long> &c) {
  bool b1 = to_left_equal(x - a, b - a), b2 = to_left_equal(x - b, c - b),
       b3 = to_left_equal(x - c, a - c), b4 = to_left_equal(x - a, c - a),
       b5 = to_left_equal(x - b, a - b), b6 = to_left_equal(x - c, b - c);
  return ((b1 && b2 && b3) || (b4 && b5 && b6));
}
long long quadrant(const pair<long long, long long> &a) {
  if (a.second < 0) {
    if (a.first < 0)
      return 0;
    else
      return 1;
  } else {
    if (a.first > 0)
      return 2;
    else
      return 3;
  }
}
bool f(const long long &a, const long long &b) {
  if (qx[a] == qx[b] && qy[a] == qy[b]) return false;
  if (qx[a] == 0 && qy[a] == 0) return true;
  if (qx[b] == 0 && qy[b] == 0) return false;
  long long n1 = quadrant(make_pair(qx[a], qy[a])),
            n2 = quadrant(make_pair(qx[b], qy[b]));
  if (n1 != n2) return n1 < n2;
  return to_left(make_pair(qx[b], qy[b]), make_pair(qx[a], qy[a]));
}
bool f2(const pair<long long, long long> &a,
        const pair<long long, long long> &b) {
  if (a == b) return false;
  if (a.first == 0 && a.second == 0) return true;
  if (b.first == 0 && b.second == 0) return false;
  long long n1 = quadrant(a), n2 = quadrant(b);
  if (n1 != n2) return n1 < n2;
  return to_left(b, a);
}
vector<pair<long long, long long>> w[5];
vector<pair<long long, long long>> points;
vector<pair<long long, long long>> allPoints;
vector<pair<long long, long long>> half[2];
void sum(vector<pair<long long, long long>> w1,
         vector<pair<long long, long long>> w2, long long id) {
  points.clear();
  allPoints.clear();
  half[0].clear();
  half[1].clear();
  pair<long long, long long> mini1 = w1[0], mini2 = w2[0];
  long long mini1it, mini2it;
  for (long long i = 0; i < w1.size(); i++) {
    if (w1[i].second > mini1.second ||
        (w1[i].second == mini1.second && w1[i].first < mini1.first)) {
      mini1it = i;
      mini1 = w1[i];
    }
  }
  for (long long i = 0; i < w2.size(); i++) {
    if (w2[i].second > mini2.second ||
        (w2[i].second == mini2.second && w2[i].first < mini2.first)) {
      mini2it = i;
      mini2 = w2[i];
    }
  }
  for (long long i = 0; i + 1 < w1.size(); i++) {
    allPoints.push_back(w1[i + 1] - w1[i]);
  }
  allPoints.push_back(w1[0] - w1[w1.size() - 1]);
  for (long long i = 0; i + 1 < w2.size(); i++) {
    allPoints.push_back(w2[i + 1] - w2[i]);
  }
  allPoints.push_back(w2[0] - w2[w2.size() - 1]);
  sort(allPoints.begin(), allPoints.end(), f2);
  pair<long long, long long> cp = mini1 + mini2;
  for (auto it : allPoints) {
    cp = cp + it;
    points.push_back(cp);
  }
  sort(points.begin(), points.end());
  vector<pair<long long, long long>> half[2];
  for (long long i = 0; i < 2; i++) {
    for (auto it : points) {
      while (half[i].size() >= 2 &&
             to_left_equal(it - half[i][half[i].size() - 2],
                           half[i].back() - half[i][half[i].size() - 2]))
        half[i].pop_back();
      half[i].push_back(it);
    }
    reverse(points.begin(), points.end());
  }
  for (auto x : half[0]) {
    w[id].push_back(x);
  }
  for (long long i = 1; i + 1 < half[1].size(); i++)
    w[id].push_back(half[1][i]);
  reverse(w[id].begin(), w[id].end());
}
void solve() {
  for (long long i = 0; i < 3; i++) {
    long long n;
    cin >> n;
    for (long long j = 0; j < n; j++) {
      long long x, y;
      cin >> x >> y;
      w[i].push_back(make_pair(x, y));
    }
  }
  sum(w[0], w[1], 3);
  sum(w[2], w[3], 4);
  auto mini = w[4][0];
  for (auto it : w[4]) {
    if (it.second < mini.second ||
        (it.second == mini.second && it.first < mini.first))
      mini = it;
  }
  for (auto &it : w[4]) it = it - mini;
  sort(w[4].begin(), w[4].end(), f2);
  long long q;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    cin >> qx[i] >> qy[i];
    qx[i] = 3 * qx[i] - mini.first;
    qy[i] = 3 * qy[i] - mini.second;
    qrs.push_back(i);
  }
  long long ptr = 1;
  sort(qrs.begin(), qrs.end(), f);
  for (long long i = 0; i < q; i++) {
    long long query = qrs[i];
    if (qy[query] < 0) {
      continue;
    }
    if (qy[query] == 0 && qx[query] == 0) {
      ans[query] = 1;
      continue;
    }
    while (ptr + 1 < w[4].size() &&
           to_left(make_pair(qx[query], qy[query]), w[4][ptr + 1])) {
      ptr++;
    }
    if (ptr + 1 < w[4].size() &&
        in_triangle(make_pair(qx[query], qy[query]), make_pair(0, 0), w[4][ptr],
                    w[4][ptr + 1]))
      ans[query] = 1;
  }
  for (long long i = 0; i < q; i++) {
    if (ans[i]) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
int32_t main() {
  long long t = 1;
  while (t--) solve();
  return 0;
}