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 int MAX_N = 3;
struct Punkt {
  long long x, y;
  Punkt operator+(const Punkt& inny) const {
    return Punkt{x + inny.x, y + inny.y};
  }
  Punkt operator-(const Punkt& inny) const {
    return Punkt{x - inny.x, y - inny.y};
  }
  Punkt operator*(const long long& inny) const {
    return Punkt{inny * x, inny * y};
  }
  long long cross(const Punkt& inny) const { return x * inny.y - y * inny.x; }
  Punkt() {}
  Punkt(long long _x, long long _y) : x(_x), y(_y) {}
  long long dot(const Punkt& inny) const { return x * inny.x + y * inny.y; }
  long long cross(const Punkt& a, const Punkt& b) const {
    return (a - *this).cross(b - *this);
  }
  long long dot(const Punkt& a, const Punkt& b) const {
    return (a - *this).dot(b - *this);
  }
  long long sqrLen() const { return this->dot(*this); }
};
void reorder_polygon(vector<Punkt>& punkty) {
  int pozycja = 0;
  for (int i = 1; i < (int)punkty.size(); i++) {
    if (punkty[i].y < punkty[pozycja].y ||
        (punkty[i].y == punkty[pozycja].y && punkty[i].x < punkty[pozycja].x)) {
      pozycja = i;
    }
  }
  rotate(punkty.begin(), punkty.begin() + pozycja, punkty.end());
}
vector<Punkt> Suma_Minkowskiego(vector<Punkt>& wielokat_1,
                                vector<Punkt>& wielokat_2) {
  reorder_polygon(wielokat_1);
  reorder_polygon(wielokat_2);
  wielokat_1.push_back(wielokat_1[0]);
  wielokat_1.push_back(wielokat_1[1]);
  wielokat_2.push_back(wielokat_2[0]);
  wielokat_2.push_back(wielokat_2[1]);
  vector<Punkt> wynikowy_wielokat;
  int wskaznik_na_wielokat_1 = 0;
  int wskaznik_na_wielokat_2 = 0;
  while (wskaznik_na_wielokat_1 < (int)wielokat_1.size() - 2 ||
         wskaznik_na_wielokat_2 < (int)wielokat_2.size() - 2) {
    wynikowy_wielokat.push_back(wielokat_1[wskaznik_na_wielokat_1] +
                                wielokat_2[wskaznik_na_wielokat_2]);
    auto cross = (wielokat_1[wskaznik_na_wielokat_1 + 1] -
                  wielokat_1[wskaznik_na_wielokat_1])
                     .cross(wielokat_2[wskaznik_na_wielokat_2 + 1] -
                            wielokat_2[wskaznik_na_wielokat_2]);
    if (cross >= 0) {
      wskaznik_na_wielokat_1++;
    }
    if (cross <= 0) {
      wskaznik_na_wielokat_2++;
    }
  }
  return wynikowy_wielokat;
}
bool lexComp(const Punkt& L, const Punkt& R) {
  return L.x < R.x || (L.x == R.x && L.y < R.y);
}
int sgn(long long val) { return val > 0 ? 1 : (val == 0 ? 0 : -1); }
vector<Punkt> seq;
int n;
Punkt translation;
bool punkt_w_trojkacie(Punkt a, Punkt b, Punkt c, Punkt punkt) {
  long long s1 = abs(a.cross(b, c));
  long long s2 =
      abs(punkt.cross(a, b)) + abs(punkt.cross(b, c)) + abs(punkt.cross(c, a));
  return s1 == s2;
}
void prepare(vector<Punkt>& punkty) {
  n = (int)punkty.size();
  int pozycja = 0;
  for (int i = 1; i < n; i++) {
    if (lexComp(punkty[i], punkty[pozycja])) {
      pozycja = i;
    }
  }
  rotate(punkty.begin(), punkty.begin() + pozycja, punkty.end());
  n--;
  seq.resize(n);
  for (int i = 0; i < n; i++) {
    seq[i] = punkty[i + 1] - punkty[0];
  }
  translation = punkty[0];
}
bool punkt_w_wielokacie_wypuklym(Punkt punkt) {
  punkt = punkt - translation;
  if (seq[0].cross(punkt) != 0 &&
      sgn(seq[0].cross(punkt)) != sgn(seq[0].cross(seq[n - 1]))) {
    return false;
  }
  if (seq[n - 1].cross(punkt) != 0 &&
      sgn(seq[n - 1].cross(punkt)) != sgn(seq[n - 1].cross(seq[0]))) {
    return false;
  }
  if (seq[0].cross(punkt) == 0) {
    return seq[0].sqrLen() >= punkt.sqrLen();
  }
  int L = 0, R = n - 1;
  while (R - L > 1) {
    int mid = (L + R) / 2;
    if (seq[mid].cross(punkt) >= 0) {
      L = mid;
    } else {
      R = mid;
    }
  }
  int pozycja = L;
  return punkt_w_trojkacie(seq[pozycja], seq[pozycja + 1], Punkt(0, 0), punkt);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<Punkt> wielokaty[MAX_N];
  for (int numer_wielokatu = 0; numer_wielokatu < MAX_N; numer_wielokatu++) {
    int ilosc_punktow;
    cin >> ilosc_punktow;
    wielokaty[numer_wielokatu].resize(ilosc_punktow);
    for (int i = 0; i < ilosc_punktow; i++) {
      cin >> wielokaty[numer_wielokatu][i].x >> wielokaty[numer_wielokatu][i].y;
    }
  }
  vector<Punkt> suma_Minkowskiego_wielokatow;
  suma_Minkowskiego_wielokatow = Suma_Minkowskiego(wielokaty[0], wielokaty[1]);
  suma_Minkowskiego_wielokatow =
      Suma_Minkowskiego(suma_Minkowskiego_wielokatow, wielokaty[2]);
  int t;
  cin >> t;
  prepare(suma_Minkowskiego_wielokatow);
  for (int i = 0; i < t; i++) {
    Punkt zapytanie;
    cin >> zapytanie.x >> zapytanie.y;
    zapytanie.x *= 3;
    zapytanie.y *= 3;
    if (punkt_w_wielokacie_wypuklym(zapytanie)) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}