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 double EPS = 1e-8;
int sgn(double x) {
  if (fabs(x) < EPS) return 0;
  return x > 0 ? 1 : -1;
}
struct point {
  double x, y;
  point() : x(0), y(0){};
  point(double a, double b) : x(a), y(b){};
  point operator-(const point &b) const { return point(x - b.x, y - b.y); }
  point operator+(const point &b) const { return point(x + b.x, y + b.y); }
  double operator*(const point &b) const { return x * b.y - y * b.x; }
  bool operator==(const point &b) const {
    return sgn(x - b.x) == 0 && sgn(y - b.y) == 0;
  }
};
struct hplane {
  point s, t;
  point cross(const hplane &b) const {
    double s1 = (b.t - s) * (b.s - s);
    double s2 = (b.s - t) * (b.t - t);
    if (sgn(s1 + s2) == 0)
      while (1)
        ;
    return point((s.x * s2 + t.x * s1) / (s2 + s1),
                 (s.y * s2 + t.y * s1) / (s2 + s1));
  }
};
point p[3][50010], pp[150010];
int num[3], id[3];
double find(int left, int right, int cnt, point s, point t) {
  if (left > right) right += cnt;
  int low = left, high = right - 1, ans = 0;
  if (sgn(pp[high % cnt].x - pp[(high + 1) % cnt].x) == 0) high--;
  int id;
  double tnum1 = (s - pp[low]) * (t - pp[low]);
  double tnum2 = (s - pp[high % cnt]) * (t - pp[high % cnt]);
  if (sgn(tnum1 - tnum2) > 0)
    id = 0;
  else
    id = 1;
  while (low <= high) {
    int mid = (low + high) / 2;
    double tnum1 = (s - pp[mid % cnt]) * (t - pp[mid % cnt]);
    double tnum2 = (s - pp[(mid + 1) % cnt]) * (t - pp[(mid + 1) % cnt]);
    if (sgn(tnum1 * tnum2) <= 0) {
      ans = mid;
      break;
    } else if (sgn(tnum1) > 0) {
      if (id == 0)
        low = mid + 1;
      else
        high = mid - 1;
    } else {
      if (id == 0)
        high = mid - 1;
      else
        low = mid + 1;
    }
  }
  hplane l1, l2;
  l1.s = s;
  l1.t = t;
  l2.s = pp[ans % cnt];
  l2.t = pp[(ans + 1) % cnt];
  return (l1.cross(l2)).y;
}
int main() {
  int n;
  while (scanf("%d", &num[0]) == 1) {
    for (int i = 0; i < 3; i++) {
      if (i != 0) scanf("%d", &num[i]);
      for (int j = 0; j < num[i]; j++) scanf("%lf%lf", &p[i][j].x, &p[i][j].y);
      p[i][num[i]] = p[i][0];
      id[i] = 0;
      for (int j = 0; j < num[i]; j++)
        if (p[i][j].y < p[i][id[i]].y)
          id[i] = j;
        else if (sgn(p[i][j].y - p[i][id[i]].y) == 0 &&
                 p[i][j].x < p[i][id[i]].x)
          id[i] = j;
    }
    int m;
    scanf("%d", &m);
    double tx = 0, ty = 0;
    int cnt = 0;
    while (true) {
      for (int i = 0; i < 3; i++)
        if (id[i] == num[i]) id[i] = 0;
      double tx = 0, ty = 0;
      for (int i = 0; i < 3; i++) {
        tx += p[i][id[i]].x;
        ty += p[i][id[i]].y;
      }
      point tp = point(tx, ty);
      while (cnt > 1 && sgn((pp[cnt - 1] - tp) * (pp[cnt - 2] - tp)) == 0)
        cnt--;
      pp[cnt] = tp;
      if (cnt != 0 && pp[cnt] == pp[0]) break;
      cnt++;
      int pos = -1;
      point next, tp1 = pp[cnt - 1];
      for (int i = 0; i < 3; i++) {
        point tp2 = point(0, 0);
        for (int j = 0; j < 3; j++) {
          if (i == j)
            tp2 = tp2 + p[j][(id[j] + 1)];
          else
            tp2 = tp2 + p[j][id[j]];
        }
        if (pos == -1) {
          pos = i;
          next = tp2;
        } else {
          point p1 = next - tp1;
          point p2 = tp2 - tp1;
          if (sgn(p1 * p2) < 0) {
            pos = i;
            next = tp2;
          }
        }
      }
      id[pos]++;
    }
    int left = 0, right = 0;
    for (int i = 0; i < cnt; i++) {
      if (sgn(pp[i].x - pp[left].x) < 0 ||
          (sgn(pp[i].x - pp[left].x) == 0 && sgn(pp[i].y - pp[left].y) < 0))
        left = i;
      if (sgn(pp[i].x - pp[right].x) > 0 ||
          (sgn(pp[i].x - pp[right].x) == 0 && sgn(pp[i].y - pp[right].y) > 0))
        right = i;
    }
    while (m--) {
      point cen;
      scanf("%lf%lf", &cen.x, &cen.y);
      cen.x *= 3;
      cen.y *= 3;
      point s, t;
      s = point(cen.x, 0);
      t = point(cen.x, 100);
      double num1 = (s - pp[left]) * (t - pp[left]),
             num2 = (s - pp[right]) * (t - pp[right]);
      if (sgn(num1 * num2) > 0) {
        puts("NO");
        continue;
      }
      double ty1, ty2;
      ty1 = find(left, right, cnt, s, t);
      ty2 = find(right, left, cnt, s, t);
      if (ty1 > ty2) swap(ty1, ty2);
      if (sgn(ty1 - cen.y) <= 0 && sgn(ty2 - cen.y) >= 0)
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}