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>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1000;
struct pt {
  long double x, y;
  pt(long double x = 0.0, long double y = 0.0) : x(x), y(y) {}
};
inline bool operator==(const pt& a, const pt& b) {
  return abs(a.x - b.x) < EPS && abs(a.y - b.y) < EPS;
}
inline pt operator+(const pt& a, const pt& b) {
  return pt(a.x + b.x, a.y + b.y);
}
inline pt operator-(const pt& a, const pt& b) {
  return pt(a.x - b.x, a.y - b.y);
}
inline pt operator*(const pt& a, const long double& c) {
  return pt(a.x * c, a.y * c);
}
inline long double angle(const pt& a) {
  long double res = atan2(a.y, a.x);
  if (res < -EPS) res += 2.0 * PI;
  return res;
}
inline bool between(const pt& c, const pt& a, const pt& b) {
  if (c.x + EPS < min(a.x, b.x) || c.x > max(a.x, b.x) + EPS) return false;
  if (c.y + EPS < min(a.y, b.y) || c.y > max(a.y, b.y) + EPS) return false;
  return true;
}
inline bool onSegm(const pt& c, const pt& a, const pt& b) {
  long double A = b.y - a.y, B = a.x - b.x, C = -(a.x * A + a.y * B);
  long double l = sqrt(sqr(A) + sqr(B));
  A /= l, B /= l, C /= l;
  if (abs(c.x * A + c.y * B + C) > EPS) return false;
  return between(c, a, b);
}
inline int sign(const pt& c, const pt& a, const pt& b) {
  long double A = b.y - a.y, B = a.x - b.x, C = -(a.x * A + a.y * B);
  long double v = A * c.x + B * c.y + C;
  return v > EPS ? 1 : v < -EPS ? -1 : 0;
}
inline bool intersect(const pt& a, const pt& b, const pt& c, const pt& d) {
  if (min(a.x, b.x) > max(c.x, d.x) + EPS ||
      max(a.x, b.x) + EPS < min(c.x, d.x))
    return false;
  if (min(a.y, b.y) > max(c.y, d.y) + EPS ||
      max(a.y, b.y) + EPS < min(c.y, d.y))
    return false;
  return sign(c, a, b) * sign(d, a, b) <= 0 &&
         sign(a, c, d) * sign(b, c, d) <= 0;
}
const int N = 100 * 1000 + 13;
int n[3];
pt p[3][N];
pt pol[3 * N];
int szpol = 0;
pt cen;
pair<long double, int> angs[3 * N];
inline bool check(const pt& a) {
  int k =
      int(lower_bound(angs, angs + szpol, make_pair((angle(a - cen)), (-1))) -
          angs);
  for (int dx = -2; dx <= 2; dx++) {
    int idx = (k + dx + szpol) % szpol;
    int i = angs[idx].second, j = angs[(idx + 1) % szpol].second;
    assert((i + 1) % szpol == j);
    if (onSegm(a, pol[i], pol[j])) return true;
    if (intersect(cen, a, pol[i], pol[j])) return false;
  }
  return true;
}
void build() {
  int idx[3] = {0, 0, 0};
  int cnt[3] = {0, 0, 0};
  for (int i = 0; i < int(3); i++)
    for (int j = 0; j < int(n[i]); j++)
      if (p[i][j].y + EPS < p[i][idx[i]].y ||
          (abs(p[i][j].y - p[i][idx[i]].y) < EPS &&
           p[i][j].x + EPS < p[i][idx[i]].x))
        idx[i] = j;
  pol[szpol++] = p[0][idx[0]] + p[1][idx[1]] + p[2][idx[2]];
  while (true) {
    vector<pair<long double, int> > ang;
    for (int i = 0; i < int(3); i++) {
      if (cnt[i] == n[i]) continue;
      int nextidx = (idx[i] + 1 == n[i] ? 0 : idx[i] + 1);
      ang.push_back(make_pair((angle(p[i][nextidx] - p[i][idx[i]])), (i)));
    }
    if (ang.empty()) break;
    sort((ang).begin(), (ang).end());
    int num = ang[0].second;
    int nextidx = (idx[num] + 1 == n[num] ? 0 : idx[num] + 1);
    pt v = p[num][nextidx] - p[num][idx[num]];
    pol[szpol] = pol[szpol - 1] + v;
    szpol++;
    idx[num] = nextidx;
    cnt[num]++;
  }
  assert(szpol == n[0] + n[1] + n[2] + 1 && pol[0] == pol[szpol - 1]);
  szpol--;
  for (int i = 0; i < int(szpol); i++) cen = cen + pol[i];
  cen = cen * (1.0 / szpol);
  for (int i = 0; i < int(szpol); i++)
    angs[i] = make_pair((angle(pol[i] - cen)), (i));
  sort(angs, angs + szpol);
}
int main() {
  for (int i = 0; i < int(3); i++) {
    scanf("%d", &n[i]);
    for (int j = 0; j < int(n[i]); j++) {
      int ax, ay;
      scanf("%d%d", &ax, &ay);
      p[i][j] = pt(ax, ay);
    }
  }
  build();
  int m;
  scanf("%d", &m);
  for (int i = 0; i < int(m); i++) {
    int ax, ay;
    scanf("%d%d", &ax, &ay);
    if (check(pt(ax, ay) * 3.0))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}