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 cmp(long long first, long long second = 0) {
  return (first <= second) ? (first < second) ? -1 : 0 : 1;
}
struct point {
  long long first, second;
  point() : first(0), second(0) {}
  point(long long X, long long Y) : first(X), second(Y) {}
  int cmp(point a) {
    if (::cmp(first, a.first)) return ::cmp(first, a.first);
    return ::cmp(second, a.second);
  }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator*(long long a) { return point(first * a, second * a); }
  long long operator*(point a) { return first * a.first + second * a.second; }
  long long operator%(point a) { return first * a.second - second * a.first; }
  bool operator<(point a) { return cmp(a) == -1; }
  bool operator==(point a) { return cmp(a) == 0; }
  bool operator!=(point a) { return cmp(a) != 0; }
  bool operator<=(point a) { return cmp(a) <= 0; }
};
int ccw(point a, point b, point c) { return cmp((b - a) % (c - a)); }
bool between(point a, point b, point c) {
  return ccw(a, b, c) == 0 && (a - b) * (c - b) <= 0;
}
vector<point> v[3], sum;
int n, m;
bool radialcomp(point a, point b) {
  if ((a.first > 0 || (a.first == 0 && a.second > 0)) &&
      (b.first < 0 || (b.first == 0 && b.second < 0)))
    return 1;
  if ((b.first > 0 || (b.first == 0 && b.second > 0)) &&
      (a.first < 0 || (a.first == 0 && a.second < 0)))
    return 0;
  long long R = a % b;
  if (R) return R > 0;
  return a * a < b * b < 0;
}
bool inside(point& a, point& b, point& c, point& p) {
  vector<point> v;
  v.push_back(a);
  v.push_back(b);
  v.push_back(c);
  v.push_back(a);
  int t = 0;
  for (int(i) = (0); (i) < (3); (i)++) {
    if (!ccw(v[i], p, v[i + 1])) return between(v[i], p, v[i + 1]);
    t += ccw(v[i], p, v[i + 1]);
  }
  return abs(t) == 3;
}
int main() {
  for (int(k) = (0); (k) < (3); (k)++) {
    point aux(2e9, 2e9);
    int N, ini = -1;
    vector<point> vet;
    scanf("%d", &N);
    for (int(i) = (0); (i) < (N); (i)++) {
      int first, second;
      scanf("%d%d", &first, &second);
      vet.push_back(point(first, second));
      if (point(first, second) < aux)
        aux.first = first, aux.second = second, ini = i;
    }
    for (int(i) = (0); (i) < (N); (i)++) v[k].push_back(vet[(i + ini) % N]);
    v[k].push_back(v[k][0]);
  }
  vector<point> op;
  for (int(i) = (0); (i) < (3); (i)++)
    for (int(j) = (0); (j) < (((int)(v[i]).size()) - 1); (j)++)
      op.push_back(v[i][j + 1] - v[i][j]);
  sort((op).begin(), (op).end(), radialcomp);
  sum.push_back(v[0][0] + v[1][0] + v[2][0]);
  for (int(i) = (0); (i) < (((int)(op).size())); (i)++) {
    point pr = op[i] + sum.back();
    while (((int)(sum).size()) > 1 &&
           !ccw(sum[((int)(sum).size()) - 2], sum[((int)(sum).size()) - 1], pr))
      sum.pop_back();
    sum.push_back(pr);
  }
  sum.pop_back();
  n = ((int)(sum).size());
  scanf("%d", &m);
  for (int(i) = (0); (i) < (m); (i)++) {
    int first, second;
    scanf("%d%d", &first, &second);
    first += first + first, second += second + second;
    point p(first, second);
    if (p < sum[0]) {
      puts("NO");
      continue;
    }
    if (p.first == sum[0].first) {
      if (p == sum[0] ||
          (sum.back().first == p.first && between(sum[0], p, sum.back())))
        puts("YES");
      else
        puts("NO");
      continue;
    }
    int ini = 1, fim = n - 2, mid, pos = -1;
    while (ini <= fim) {
      mid = (ini + fim) >> 1;
      int v = ccw(sum[0], sum[mid], p) + ccw(sum[0], sum[mid + 1], p);
      if (v == 2)
        ini = mid + 1;
      else if (v == -2)
        fim = mid - 1;
      else {
        pos = mid;
        break;
      }
    }
    if (inside(sum[0], sum[pos], sum[pos + 1], p))
      puts("YES");
    else
      puts("NO");
  }
}