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 <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int inf = int(1e9);
const long double pi = 2 * acos(0);
int n, i, j, k, l, p, g;
long long x, y;
struct node {
  long long x, y;
  long double alp;
} a[150010], c[150010], st, z;
long double s[150010];
bool v[150010];
long long xj(node p, node a, node b) {
  return (a.x - p.x) * (b.y - p.y) - (a.y - p.y) * (b.x - p.x);
}
bool on(node p, node a, node b) {
  return p.x >= min(a.x, b.x) && p.x <= max(a.x, b.x) && p.y >= min(a.y, b.y) &&
         p.y <= max(a.y, b.y) && xj(p, a, b) == 0;
}
bool cmp(node a, node b) { return a.alp < b.alp; }
node operator+(node a, node b) { return (node){a.x + b.x, a.y + b.y, 0}; }
pair<long long, long long> u;
void readg() {
  int i;
  read(n);
  for (i = 1; i <= n; i++) read(c[i].x, c[i].y), c[i].x *= 3, c[i].y *= 3;
  u = make_pair(inf, inf);
  for (i = 1; i <= n; i++) u = min(u, make_pair(c[i].x, c[i].y));
  st.x += u.first;
  st.y += u.second;
  for (i = 1; i <= n; i++) {
    int dx = c[i % n + 1].x - c[i].x, dy = c[i % n + 1].y - c[i].y;
    long double alp = atan2(dy, dx);
    if (alp < 0) alp += 2 * pi;
    a[++g] = (node){dx, dy, alp};
  }
}
bool in(node p, node a, node b, node c) {
  if (on(p, a, b) || on(p, a, c) || on(p, b, c)) return 1;
  return (abs(xj(p, a, b)) + abs(xj(p, b, c)) + abs(xj(p, a, c)) ==
          abs(xj(a, b, c)));
}
int main() {
  readg();
  readg();
  readg();
  sort(a + 1, a + 1 + g, cmp);
  node op = (node){0, 0, 0};
  st.x /= 3;
  st.y /= 3;
  for (i = 1; i <= g; i++) {
    c[i] = op;
    op = op + a[i];
  }
  for (i = 1; i <= g; i++) c[i].x /= 3, c[i].y /= 3;
  u = make_pair(inf, inf);
  for (i = 1; i <= g; i++) u = min(u, make_pair(c[i].x, c[i].y));
  for (i = 1; i <= g; i++) c[i].x += st.x - u.first, c[i].y += st.y - u.second;
  memset(v, 1, sizeof(v));
  for (i = 2; i <= g; i++)
    if (xj(c[i - 1], c[i], c[i % g + 1]) == 0) v[i] = 0;
  l = 0;
  for (i = 1; i <= g; i++)
    if (v[i]) a[++l] = c[i];
  g = l;
  s[1] = 0;
  for (i = 2; i <= g; i++) s[i] = atan2(a[i].y - a[1].y, a[i].x - a[1].x);
  int q;
  for (read(q); q; q--) {
    read(z.x, z.y);
    z.x *= 3;
    z.y *= 3;
    long double t = atan2(z.y - a[1].y, z.x - a[1].x);
    if (t < 0) t += 2 * pi;
    p = upper_bound(s + 1, s + 1 + g, t) - s - 1;
    if (in(z, a[1], a[p], a[(p == g) ? 2 : p + 1]) ||
        in(z, a[1], a[p], a[(p == 2) ? g : p - 1]))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}