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;
int Sig(double a) { return a < -1e-8 ? -1 : (a > 1e-8); }
struct Point {
  double x, y;
  Point() {}
  Point(double x0, double y0) : x(x0), y(y0) {}
  void in() { scanf("%lf%lf", &x, &y); }
  void out() { printf("%.3f %.3f\n", x, y); }
  Point operator*(double t) { return Point(t * x, t * y); }
  double len() { return sqrt(x * x + y * y); }
  double operator*(Point pt) { return x * pt.y - y * pt.x; }
  double operator^(Point pt) { return pt.x * x + pt.y * y; }
  Point operator-(Point pt) { return Point(x - pt.x, y - pt.y); }
  Point operator+(Point pt) { return Point(x + pt.x, y + pt.y); }
  Point turnlen(double l) {
    double r = l / len();
    return Point(x * r, y * r);
  }
  bool operator==(Point pt) {
    if (fabs(x - pt.x) < 1e-8 && fabs(y - pt.y) < 1e-8)
      return true;
    else
      return false;
  }
};
Point o;
double Xmult(Point a, Point b, Point o) {
  return (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
}
double Dis(Point a, Point b) { return (a - b).len(); }
int con[1000010];
int cn;
int cmpconvex(Point a, Point b) {
  double d = Xmult(o, a, b);
  if (d > 0) return 1;
  if (d == 0 && Dis(a, o) < Dis(b, o)) return 1;
  return 0;
}
Point fuck[1000010];
int Graham(Point p[], int n) {
  int ind = 0;
  for (int i = 1; i < n; i++)
    if (p[ind].y > p[i].y || (p[ind].y == p[i].y && p[ind].x > p[i].x)) ind = i;
  swap(p[ind], p[0]);
  o = p[0];
  sort(p + 1, p + n, cmpconvex);
  con[0] = 0;
  con[1] = 1;
  cn = 1;
  for (int i = 2; i < n; i++) {
    while (cn > 0 && Sig(Xmult(p[con[cn - 1]], p[con[cn]], p[i])) <= 0) cn--;
    con[++cn] = i;
  }
  int tmp = cn;
  for (int i = n - 2; i >= 0; i--) {
    while (cn > tmp && Sig(Xmult(p[con[cn - 1]], p[con[cn]], p[i])) <= 0) cn--;
    con[++cn] = i;
  }
  for (int i = 0; i < cn; i++) fuck[i] = p[con[i]];
  for (int i = 0; i < cn; i++) p[i] = fuck[i];
  return cn;
}
Point a[1000010];
Point b[1000010];
Point c[1000010];
int Minkowski_sum(Point a[], int na, Point b[], int nb) {
  int ida = 0;
  for (int i = 1; i < na; i++) {
    if (a[i].y < a[ida].y)
      swap(i, ida);
    else if (a[i].y == a[ida].y && a[i].x < a[ida].x)
      swap(i, ida);
  }
  int idb = 0;
  for (int i = 0; i < nb; i++) {
    if (b[i].y < b[idb].y)
      swap(i, idb);
    else if (b[i].y == b[idb].y && b[i].x < b[idb].x)
      swap(i, idb);
  }
  int i, j;
  int nc = 0;
  i = j = 0;
  c[nc++] = a[ida] + b[idb];
  while (i < na || j < nb) {
    int flag;
    if (i == na)
      flag = 1;
    else if (j == nb)
      flag = 0;
    else {
      int k = (ida + i) % na;
      int nk = (k + 1) % na;
      double va = atan2(a[nk].y - a[k].y, a[nk].x - a[k].x);
      k = (idb + j) % nb;
      nk = (k + 1) % nb;
      double vb = atan2(b[nk].y - b[k].y, b[nk].x - b[k].x);
      while (Sig(va) < 0) va += acos(-1.0) * 2;
      while (Sig(vb) < 0) vb += acos(-1.0) * 2;
      if (va < vb)
        flag = 0;
      else
        flag = 1;
    }
    if (flag) {
      int k = (idb + j) % nb;
      int nk = (k + 1) % nb;
      c[nc++] = c[nc - 1] + (b[nk] - b[k]);
      j++;
    } else {
      int k = (ida + i) % na;
      int nk = (k + 1) % na;
      c[nc++] = c[nc - 1] + (a[nk] - a[k]);
      i++;
    }
  }
  return nc;
}
bool In_convex(Point o, Point p[], int n) {
  if ((p[1] - p[0]) * (o - p[0]) < 0) return false;
  if ((p[n - 1] - p[0]) * (o - p[0]) > 0) return false;
  int l = 1;
  int r = n - 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if ((p[m] - p[0]) * (o - p[0]) > 0)
      l = m;
    else
      r = m;
  }
  return (p[r] - p[l]) * (o - p[l]) >= 0;
}
int main() {
  int na, nb;
  scanf("%d", &na);
  for (int i = 0; i < na; i++) a[i].in();
  scanf("%d", &nb);
  for (int i = 0; i < nb; i++) b[i].in();
  na = Minkowski_sum(a, na, b, nb);
  for (int i = 0; i < na; i++) a[i] = c[i];
  scanf("%d", &nb);
  for (int i = 0; i < nb; i++) b[i].in();
  na = Minkowski_sum(a, na, b, nb);
  for (int i = 0; i < na; i++) a[i] = c[i];
  na = Graham(a, na);
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    Point o;
    o.in();
    o.x *= 3;
    o.y *= 3;
    if (In_convex(o, a, na))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}