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.

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.

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.

NoteFor 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.

// meow-meow
#pragma GCC optimize("O3", "unroll-loops")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = min((a), (b))
#define maxeq(a, b) (a) = max((a), (b))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

struct vect {
	ll x, y;
	vect() {}
	vect(ll x1, ll y1) {
		x = x1, y = y1;
	}
	vect operator + (vect &a) {
		return vect(x + a.x, y + a.y);
	}
	vect operator - (vect &a) {
		return vect(x - a.x, y - a.y);
	}
	ll operator * (vect &a) {
		return x * a.x + y * a.y;
	}
	ll operator % (vect &a) {
		return x * a.y - y * a.x;
	}
	vect operator * (ll k) {
		return vect(x*k, y*k);
	}
	vect rotate(ld a) {
		return vect(x*cos(a) - y * sin(a), x*sin(a) + y * cos(a));
	}
	bool operator == (vect a) {
		return pll(x, y) == pll(a.x, a.y);
	}
	bool operator < (vect &a) {
		return pll(y, x) < pll(a.y, a.x);
	}
};

bool comp(vect &a, vect &b) {
	if (a.y >= 0 && b.y < 0) {
		return true;
	}
	if (a.y < 0 && b.y >= 0) {
		return false;
	}
	if (a.y == 0 && b.y == 0) {
		if (a.x > 0 && b.x < 0) {
			return true;
		} else if (a.x < 0 && b.x > 0) {
			return false;
		}
		return a.x < b.x;
	}
	ll p = a % b;
	if (p == 0) {
		return a * a < b * b;
	}
	return p > 0;
}

vector<vect> x1, x2, x3;
vector<vect> mink;
vect O;

vector<vect> get(vector<vect> &a, vector<vect> &b, vector<vect> &c) {
	vector<vect> d;

	a.pb(a[0]);
	for (ll i = 0; i < sz(a) - 1; i++) {
		d.pb(a[i + 1] - a[i]);
	}
	a.popb();
	sort(all(a));

	b.pb(b[0]);
	for (ll i = 0; i < sz(b) - 1; i++) {
		d.pb(b[i + 1] - b[i]);
	}
	b.popb();
	sort(all(b));

	c.pb(c[0]);
	for (ll i = 0; i < sz(c) - 1; i++) {
		d.pb(c[i + 1] - c[i]);
	}
	c.popb();
	sort(all(c));

	sort(all(d), comp);

	vect A = a[0] + b[0] + c[0];

	vector<vect> res;
	res.pb(A);
	res.pb(res.back() + d[0]);
	for (ll i = 1; i < sz(d); i++) {
		if (d[i] == vect(0, 0)) {
//			continue;
		}
		vect v1 = (res.back() + d[i]) - res.back();
		vect v2 = res.back() - res[sz(res) - 2];
		ll p = v1 % v2;
		if (p == 0) {
			res[sz(res) - 1] = res.back() + d[i];
			continue;
		}
		res.pb(res.back() + d[i]);
	}
	return res;
}

int sign(ll a) {
	if (a > 0) {
		return 1;
	} else if (a < 0) {
		return -1;
	} else {
		return 0;
	}
}

bool check(vect P, vect A, vect B) {
	vect OP = P - O, OA = A - O, OB = B - O;
	ll p1 = OP % OA, p2 = OA % OB;
	return sign(p1) != sign(p2);
}

bool triangle(vect P, vect A, vect B, vect C) {
	vect PA = A - P, PB = B - P, PC = C - P, AB = B - A, AC = C - A;
	ull s1 = ull(abs(PA % PB)) + ull(abs(PB % PC)) + ull(abs(PC % PA));
	ull s2 = abs(AB % AC);
	return s1 == s2;
}

bool solve(vect P) {
	ll n = sz(mink);
	ll l = -1, r = n - 1;
	while (r - l > 1) {
		ll m = (l + r) / 2;
		if (check(P, mink[m], mink[m + 1])) {
			l = m;
		} else {
			r = m;
		}
	}
	if (l == -1) {
		return false;
	}
	return triangle(P, O, mink[l], mink[l + 1]);
}

void solve() {
	ll m;
	cin >> m;
	mink = get(x1, x2, x3);
	mink.popb();
	O = mink.back();
	mink.popb();
	for (ll i = 0; i < m; i++) {
		vect P;
		cin >> P.x >> P.y;
		P.x *= 3, P.y *= 3;
		bool ans = solve(P);
		if (ans) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

void change(vector<vect> &a) {
	ll n;
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i].x >> a[i].y;
	}
}

void read() {
	change(x1);
	change(x2);
	change(x3);
}

int main() {
	fast;
	read();
	solve();
	return 0;
}

#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;

struct pt
{
    ll x, y;
    static ll cross(const pt& p, const pt& q)
    {
        return p.x * q.y - p.y * q.x;
    }
    int halfplane() const
    {
        return x > 0 || (x == 0 && y < 0);
    }
    bool operator<(const pt& other)
    {
        if (halfplane() != other.halfplane()) {
            return halfplane() > other.halfplane();
        }
        return cross(*this, other) > 0;
    }
};

pt operator+(const pt& p, const pt& q)
{
    return {p.x + q.x, p.y + q.y};
}

pt operator-(const pt& p, const pt& q)
{
    return {p.x - q.x, p.y - q.y};
}

void normalize(vector<pt>& p) //left top to p[0]
{
    int id = 0;
    for (int i = 1; i < sz(p); ++i) {
        if (p[i].x < p[id].x || (p[i].x == p[id].x && p[i].y > p[id].y)) {
            id = i;
        }
    }
    vector<pt> ans;
    for (int i = id; i < sz(p); ++i) {
        ans.pb(p[i]);
    }
    for (int i = 0; i < id; ++i) {
        ans.pb(p[i]);
    }
    p.swap(ans);
}

vector<pt> operator+(const vector<pt>& a, const vector<pt>& b)
{
    vector<pt> v;
    for (int i = 0; i < sz(a); ++i) {
        v.pb(a[(i + 1) % sz(a)] - a[i]);
    }
    for (int i = 0; i < sz(b); ++i) {
        v.pb(b[(i + 1) % sz(b)] - b[i]);
    }
    sort(all(v));
    vector<pt> ans;
    ans.pb(a[0] + b[0]);
    for (int i = 0; i < sz(v) - 1; ++i) {
        pt p = ans.back() + v[i];
        //cout << v[i].x << " " << v[i].y << "\n";
        if (i && v[i].x * v[i - 1].y == v[i].y * v[i - 1].x) {
            ans.pop_back();
        }
        ans.pb(p);
    }
    return ans;
}

ll area(const pt& a, const pt& b, const pt& c)
{
    pt x = b - a, y = c - a;
    return abs(pt::cross(x, y));
}

bool belong(const pt& p, const vector<pt>& v)
{
    int lf = 1, rg = sz(v) - 1;
    while (lf < rg - 1) {
        int md = (lf + rg) >> 1;
        pt v1 = v[md] - v[0], v2 = p - v[0];
        if (pt::cross(v1, v2) > 0) {
            lf = md;
        } else {
            rg = md;
        }
    }
    return area(v[0], v[lf], v[rg]) == area(v[0], p, v[lf]) + area(v[0], p, v[rg]) + area(v[lf], p, v[rg]);
}

int main()
{

    vector<pt> v;
    for (int i = 0; i < 3; ++i) {
        int n;
        cin >> n;
        vector<pt> a(n);
        for (int j = 0; j < n; ++j) {
            cin >> a[j].x >> a[j].y;
        }
        normalize(a);
        if (!i) {
            v.swap(a);
            continue;
        }
        vector<pt> ans = v + a;
        v.swap(ans);
    }

    int q;
    cin >> q;
    while (q--) {
        pt p;
        cin >> p.x >> p.y;
        p.x *= 3, p.y *= 3;
        if (belong(p, v)) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }

}

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double lf;
typedef pair<int, int> pii;

const lf eps = 1e-12;

ll cross(pii a, pii b) {
    return 1LL * a.first * b.second - 1LL * a.second * b.first;
}
ll ccw(pii a, pii b, pii c) {
    pii p = pii(b.first - a.first, b.second - a.second);
    pii q = pii(c.first - a.first, c.second - a.second);
    return cross(p, q);
}

bool up(pii a) {
    return a.second > 0 || (a.second == 0 && a.first > 0);
}
bool cmp(pii a, pii b) {
    if(up(a) != up(b)) return up(a);
    else return cross(a, b) > 0;
}

struct CHT {
    vector<lf> M, B;
    void init() {
        M.clear();
        B.clear();
    }
    bool bad(int l1, int l2, int l3) {
        return (B[l3] - B[l1]) / (M[l1] - M[l3]) <= (B[l2] - B[l1]) / (M[l1] - M[l2]) + eps;
    }
    void add(lf m, lf b) {
        M.push_back(m);
        B.push_back(b);
        while(M.size() >= 3 && bad(M.size() - 3, M.size() - 2, M.size() - 1)) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
    }
    lf query(lf x) {
        if(M.size() == 0) return 1e18;
        int s = 0, e = (int)M.size() - 2, p = 0;
        while(s <= e) {
            int m = (s + e)>>1;

            if(x >= (B[m + 1] - B[m]) / (M[m] - M[m + 1])) {
                p = m + 1;
                s = m + 1;
            }
            else e = m - 1;
        }
        return M[p] * x + B[p];
    }
} le, ri;

vector<pii> V, tmp, P;
pii O;

int main() {
    for(int x = 0; x < 3; x++) {
        int n; scanf("%d", &n);

        vector<pii> P(n);
        for(int i = 0; i < n; i++) {
            scanf("%d %d", &P[i].first, &P[i].second);
        }

        pii mn = pii(2e9, 2e9);
        for(int i = 0; i < n; i++) {
            int j = (i + 1) % n;

            V.push_back(pii(P[j].first - P[i].first, P[j].second - P[i].second));
            if(mn.second > P[i].second || (mn.second == P[i].second && mn.first > P[i].first)) mn = P[i];
        }

        O.first += mn.first;
        O.second += mn.second;
    }

    sort(V.begin(), V.end(), cmp);

    for(int i = 0; i < V.size(); i++) {
        if(tmp.size() == 0 || cross(tmp.back(), V[i]) != 0) tmp.push_back(V[i]);
        else {
            tmp.back().first += V[i].first;
            tmp.back().second += V[i].second;
        }
    }

    V = tmp;

    P.push_back(O);
    for(int i = 0; i < (int)V.size() - 1; i++) {
        pii t = P.back();
        t.first += V[i].first;
        t.second += V[i].second;
        P.push_back(t);
    }

    le.init();
    ri.init();
    int mn = 2e9;
    int mx = -2e9;
    for(int i = 0; i < V.size(); i++) {
        if(V[i].second > 0) {
            lf m = (lf)V[i].first / V[i].second;
            lf b = (lf)P[i].first - m * P[i].second;

            ri.add(m, b);
        }
        if(V[i].second < 0) {
            lf m = (lf)V[i].first / V[i].second;
            lf b = (lf)-P[i].first + m * P[i].second;

            le.add(m, b);
        }

        mn = min(mn, P[i].second);
        mx = max(mx, P[i].second);
    }

    int m; scanf("%d", &m);

    for(int i = 0; i < m; i++) {
        int x, y; scanf("%d %d", &x, &y);
        x *= 3;
        y *= 3;

        if(y < mn || mx < y) {
            printf("NO\n");
            continue;
        }

        if(-le.query(-y) <= x + eps && x <= ri.query(y) + eps) {
            printf("YES\n");
        }
        else printf("NO\n");
    }
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#define rep(i,j,k) for (int i=j; i<=k; i++)
using namespace std;
typedef long long LL;

const int maxn=210000;

const double eps=1e-13;

int sign(double x){
    if (x<-eps) return -1; return x>eps;
}

class point{public:
    LL x,y;
    point(LL _x,LL _y):x(_x),y(_y){}
    point(){}
    bool operator<(point a){
        return (y<a.y||y==a.y&&x<a.x);
    }
    point operator+(point a){
        return point(x+a.x,y+a.y);
    }
    point operator-(point a){
        return point(x-a.x,y-a.y);
    }
    LL operator*(point a){
        return x*a.y-y*a.x;
    }
    int pos(){
        if (x>=0&&y>=0) return 1;
        if (x<=0&&y>=0) return 2;
        if (x<=0&&y<=0) return 3;
        return 4;
    }
    void read(){
        int _x,_y;
        scanf("%d%d",&_x,&_y);
        x=_x, y=_y;
    }
};

bool lower(point a, point b){
    if (a.pos()>b.pos()) return false;
    if (a.pos()<b.pos()) return true;
    return a*b>0;
}

int n[4],tot,now[4]={1,1,1,1};
point a[4][maxn],b[maxn];

bool in_triangle(point a, point b, point c, point q){
    return ((q-a)*(b-a)<=0 && (q-b)*(c-b)<=0 && (q-c)*(a-c)<=0);
}

int main(){
    point ori(0,0);
    rep(o,1,3){
        cin>>n[o];
        int m=1;
        rep(i,1,n[o]){
            a[o][i].read();
            if (a[o][i]<a[o][m]) m=i;
        }
        ori=ori+a[o][m];
        rep(i,1,n[o]) b[i]=a[o][i];
        rep(i,m,n[o]) a[o][i-m+1]=b[i];
        rep(i,1,m-1)  a[o][n[o]-m+1+i]=b[i];
        a[o][n[o]+1]=a[o][1];
    }

    tot=1; b[1]=ori;

    while (1){
        point q;
        int sp=-1;
        rep(o,1,3)if(now[o]<=n[o]){
            if(sp==-1 || lower(a[o][now[o]+1]-a[o][now[o]],q) )
                q=a[o][now[o]+1]-a[o][now[o]], sp=o;
        }
        if (sp==-1) break;
        now[sp]++;
        tot++;
        b[tot]=b[tot-1]+q;
        if (tot>=3&&(b[tot]-b[tot-2])*(b[tot-1]-b[tot-2])==0)
            b[tot-1]=b[tot],--tot;
    }

    int m;
    tot--;
    cin>>m;
    rep(mm,1,m){
        point q;
        q.read();
        q.x*=3,q.y*=3;

        int l=2,r=tot,mid;
        while (l<r){
            if (l+1==r){
                if (in_triangle(b[1],b[l],b[r],q))
                    puts("YES"); else
                    puts("NO");
                break;
            }
            mid=(l+r)/2;
            LL tmp=(b[mid]-b[1])*(q-b[1]);
            if (tmp<0)
                r=mid; else
                l=mid;
        }
    }

    return 0;
}

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;

pii operator+(const pii &a, const pii &b) {
  return pii(a.first + b.first, a.second + b.second);
}
pii operator-(const pii &a, const pii &b) {
  return pii(a.first - b.first, a.second - b.second);
}

ll productVect(const pii &a, const pii &b) {
  ll A = a.first;
  ll B = a.second;
  ll C = b.first;
  ll D = b.second;
  return A * D - B * C;
}

bool pii_comp_x(const pii &a, const pii &b) { return a.first < b.first; }

int underChain(const vpii &chn, const pii &pnt) {
  if (chn[0].first > pnt.first || chn.back().first < pnt.first)
    return 0;
  int i = lower_bound(chn.begin(), chn.end(), pnt, pii_comp_x) - chn.begin();
  if (i)
    --i;
  return (productVect(chn[i + 1] - chn[i], pnt - chn[i]) <= 0);
}

void convex_minko_sum(const vpii &a, const vpii &b, vpii &out) {
  out.clear();
  int i = 0, j = 0;
  for (int q = 0; q < a.size(); ++q)
    if (a[q] < a[i])
      i = q;
  for (int q = 0; q < b.size(); ++q)
    if (b[q] < b[j])
      j = q;
  do {
    out.push_back(a[i] + b[j]);
    ll pro =
        productVect(a[(i + 1) % a.size()] - a[i], b[(j + 1) % b.size()] - b[j]);
    if (pro >= 0)
      i = (i + 1) % a.size();
    if (pro <= 0)
      j = (j + 1) % b.size();
  } while (a[i] + b[j] != out[0]);
}

int main() {
  vpii T[5];
  for (int q = 0; q < 3; ++q) {
    int sz;
    scanf("%d", &sz);
    for (int w = 0; w < sz; ++w) {
      pii u;
      scanf("%d %d", &u.first, &u.second);
      T[q].push_back(u);
    }
  }
  convex_minko_sum(T[0], T[1], T[3]);
  convex_minko_sum(T[2], T[3], T[4]);

  vpii up, down;
  for (int q = 0; q < T[4].size(); ++q) {
    pii a = T[4][q];
    pii b = T[4][(q + 1) % T[4].size()];
    if (a.first < b.first) {
      if (down.empty() || down.back() != a)
        down.push_back(a);
      down.push_back(b);
    }
    if (a.first > b.first) {
      if (up.empty() || up.back() != a)
        up.push_back(a);
      up.push_back(b);
    }
  }
  reverse(up.begin(), up.end());
  for (int q = 0; q < down.size(); ++q)
    down[q].second *= -1;

  int Quest;
  scanf("%d", &Quest);
  for (int q = 0; q < Quest; ++q) {
    int a, b;
    scanf("%d %d", &a, &b);
    a *= 3, b *= 3;
    printf("%s\n",
           (underChain(up, pii(a, b)) && underChain(down, pii(a, -b))) ? "YES"
                                                                       : "NO");
  }

  return 0;
}

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>

using namespace std;
using ld = long double;
#define int long long
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ff first
#define ss second

constexpr int INF = 1e9 + 9;

struct r {
    int x, y;
    r(int x, int y) : x(x), y(y) {}
    r() : x(0), y(0) {}
    r(r a, r b) : r(b.x - a.x, b.y - a.y) {}
};

r operator+(r a, r b) {
    return r(a.x + b.x, a.y + b.y);
}

r operator-(r a, r b) {
    return r(a.x - b.x, a.y - b.y);
}

int operator*(r a, r b) {
    return a.x * b.y - a.y * b.x;
}

int operator%(r a, r b) {
    return a.x * b.x + a.y * b.y;
}

bool operator<(r a, r b) {
    return a * b > 0;
}

bool operator>(r a, r b) {
    return a * b < 0;
}

bool operator<=(r a, r b) {
    return a * b >= 0;
}

bool operator>=(r a, r b) {
    return a * b <= 0;
}

void sort(vector<r> &p) {
    vector<r> a1, a2;
    for (auto pt : p) {
        if (pt.y >= 0) {
            a1.push_back(pt);
        } else {
            a2.push_back(pt);
        }
    }
    sort(all(a1));
    sort(all(a2));
    p = a1;
    for (auto el : a2) {
        p.push_back(el);
    }
}

vector<r> get_round(vector<r> &p) {
    vector<r> ans;
    for (int i = 1; i < p.size(); i++) {
        ans.emplace_back(p[i - 1], p[i]);
        while (ans.size() > 1 && ans[ans.size() - 2] * ans.back() == 0) {
            auto p1 = ans[ans.size() - 2];
            auto p2 = ans.back();
            ans.pop_back(); ans.pop_back();
            ans.push_back(p1 + p2);
        }
    }
    ans.emplace_back(p.back(), p.front());
    sort(ans);
    return ans;
}

vector<r> operator+(vector<r> &a, vector<r> &b) {
    auto ra = get_round(a);
    auto rb = get_round(b);
    vector<r> tr_ans(ra.size() + rb.size());
    merge(all(ra), all(rb), tr_ans.begin());
    vector<r> r_ans;
    for (int i = 0; i < tr_ans.size(); i++) {
        r_ans.emplace_back(tr_ans[i]);
        while (r_ans.size() > 1 && r_ans[r_ans.size() - 2] * r_ans.back() == 0) {
            auto p1 = r_ans[r_ans.size() - 2];
            auto p2 = r_ans.back();
            r_ans.pop_back(); r_ans.pop_back();
            r_ans.push_back(p1 + p2);
        }
    }
    sort(r_ans);
    auto mna = *min_element(all(a), [](auto a, auto b){
        if (a.y == b.y) {
            return a.x < b.x;
        }
        return a.y < b.y;
    });
    auto mnb = *min_element(all(b), [](auto a, auto b){
        if (a.y == b.y) {
            return a.x < b.x;
        }
        return a.y < b.y;
    });
    vector<r> ans;
    ans.push_back(mnb + mna);
    for (auto vc : r_ans) {
        ans.push_back(ans.back() + vc);
    }
    ans.pop_back();
    return ans;
}

struct Finder {
    vector<r> vecs;
    r st;
    Finder(vector<r> &p)
    {
        st = p[0];
        for (int i = 1; i < p.size(); i++) {
            vecs.emplace_back(p[0], p[i]);
        }
    }
    bool find(r p) {
        p = p - st;
        if (vecs.front() <= p && p <= vecs.back()) {
            auto it = lower_bound(all(vecs), p);
            int i = it - vecs.begin();
            if (i == 0) {
                i++;
            }
            return vecs[i - 1] <= p && p <= vecs[i] && r(vecs[i - 1], p) >= r(vecs[i - 1], vecs[i]);
        }
        return false;
    }
};

istream &operator>>(istream &in, vector<r> &p) {
    int n;
    cin >> n;
    p.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i].x >> p[i].y;
    }
    return in;
}

void run() {
    vector<r> a, b, c;
    cin >> a >> b >> c;
    auto mink = a + b;
    mink = mink + c;
    Finder fnd(mink);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        r p;
        cin >> p.x >> p.y;
        p.x *= 3;
        p.y *= 3;
        if (fnd.find(p)) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
}

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    int t = 1;
    //cin >> t;
    while (t--)
        run();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 50000;

struct P{
	ll x, y;
	P():x(0), y(0) {}
	P(ll a, ll b):x(a), y(b) {}
	void sc() { scanf("%lld%lld", &x, &y); }
	P operator +(P const &o)const { return P(x + o.x, y + o.y); }
	P operator -(P const &o)const { return P(x - o.x, y - o.y); }
	P operator *(int s)const { return P(x * s, y * s); }
	double ang()const { return atan2(y, x); }
	bool operator <(P const &o)const { return ang() < o.ang(); }
	ll operator |(P const &o)const { return x * o.y - y * o.x; }
	bool operator ==(P const &o)const { return (*this | o) == 0; }
}p[N], b;

vector<P> h;

void sc(){
	int n, l = h.size(), mn = 0;
	scanf("%d", &n);
	f(i, 0, n)p[i].sc();
	f(i, 1, n)if (p[i].y > p[mn].y || p[i].y == p[mn].y && p[i].x < p[mn].x)mn = i;
	f(i, mn, n)h.push_back(p[i]);
	f(i, 0, mn)h.push_back(p[i]);
	P t = h[l];
	b = b + t;
	f(i, l, h.size() - 1)h[i] = h[i + 1] - h[i];
	h.back() = t - h.back();
	inplace_merge(h.begin(), h.begin() + l, h.end());
	int j = 0;
	f(i, 1, h.size())if (h[j] | h[i])swap(h[++j], h[i]);
	else h[j] = h[j] + h[i];
	h.resize(j + 1);
}

bool in(P const &o){
	int l = 0, r = h.size() - 1;
	while (r > l){
		int m = l + r + 1 >> 1;
		if ((o - h[0] | h[m] - h[0]) >= 0)r = m - 1;
		else l = m;
	}
	if (l + 1 == h.size())return false;
	if (l == 0 && (h[1] - h[0] | o - h[0]) == 0)return (h[2] - h[1] | o - h[1]) >= 0;
	return (h[l + 1] - h[l] | o - h[l]) >= 0;
}

int main(){
	f(i, 0, 3)sc();
	P t = h[0];
	h[0] = b;
	f(i, 1, h.size()){
		P tt = h[i];
		h[i] = t + h[i - 1];
		t = tt;
	}
	int m;
	scanf("%d", &m);
	while (m--){
		P p;
		p.sc();
		printf("%s\n", in(p * 3) ? "YES" : "NO");
	}
}

//
//  main.cpp
//  CF87E Mogohu-Rea Idol（闵可夫斯基和）
//
//  Created by GoatWu on 2020/10/11.
//

#include <bits/stdc++.h>
#define nex(i) ((i+1)%n)
#define bef(i) ((i-1+n)%n)
#define INF 1000000007
using namespace std;
typedef double db;
const db eps = 1e-8;
inline db sqr(db x) {
    return x * x;
}
int cmp(db x){
    return fabs(x) < eps ? 0 : (x > 0 ? 1 : -1);
}

namespace Point {
    struct pt {
        db x, y;
        pt() {}
        pt(db a, db b) : x(a), y(b) {}
        void input() {
            scanf("%lf%lf", &x, &y);
        }

        friend pt operator + (const pt &a, const pt &b) {
            return pt(a.x + b.x, a.y + b.y);
        }
        friend pt operator - (const pt &a, const pt &b) {
            return pt(a.x - b.x, a.y - b.y);
        }
        friend bool operator == (const pt &a, const pt &b) {
            return !cmp(a.x - b.x) && !cmp(a.y - b.y);
        }
        friend pt operator * (const pt &a, const db &b) {
            return pt(a.x * b, a.y * b);
        }
        friend pt operator * (const db &a, const pt &b) {
            return pt(a * b.x, a * b.y);
        }
        friend pt operator / (const pt &a, const db &b) {
            return pt(a.x / b, a.y / b);
        }
        friend bool operator < (const pt &a, const pt &b) {
            return cmp(a.x - b.x) < 0 || (cmp(a.x - b.x) == 0 && cmp(a.y - b.y) < 0);
        }
        double norm() {
            return sqrt(sqr(x) + sqr(y));
        }
    };
    db det(const pt &a, const pt &b) {
        return a.x * b.y - a.y * b.x;
    }
    db dot(const pt &a, const pt &b) {
        return a.x * b.x + a.y * b.y;
    }
    db dist(const pt &a, const pt &b) {
        return (a - b).norm();
    }
    pt rotate_point(const pt &p, db A) {
        db tx = p.x, ty = p.y;
        return pt(tx * cos(A) - ty * sin(A), tx * sin(A) + ty * cos(A));
    }
}
using namespace Point;

namespace Convex {
    struct conv {
        vector<pt> P;
        conv(int sz = 0){
            P.resize(sz);
        }
    };

    conv get_convex(vector<pt> a) {
        // 若要凸包上包含共线，则下面while中的小于等于改为小于
        conv res(2 * (int)a.size() + 5);
        sort(a.begin(), a.end());
        a.erase(unique(a.begin(), a.end()), a.end());
        int m = 0, sz = (int)a.size();;
        for (int i = 0; i < sz; i++) {
            while (m > 1 && cmp(det(res.P[m-1] - res.P[m-2], a[i] - res.P[m-2])) <= 0) m--;
            res.P[m++] = a[i];
        }
        int k = m;
        for(int i = sz - 2; i >= 0; i--) {
            while (m > k && cmp(det(res.P[m-1] - res.P[m-2], a[i] - res.P[m-2])) <= 0) m--;
            res.P[m++] = a[i];
        }
        res.P.resize(m);
        if (sz > 1) res.P.resize(m - 1);
        return res;
    }

    int containOlogn(const conv &a, const pt &b) {
        int n = (int)a.P.size();
        pt g = (a.P[0] + a.P[n / 3] + a.P[2 * n / 3]) / 3.0;
        int l = 0, r = n;
        while (l + 1 < r) {
            int mid = (l + r) >> 1;
            int dl = cmp(det(a.P[l] - g, b - g));
            if (cmp(det(a.P[l] - g, a.P[mid] - g)) > 0) {
                if(dl >= 0 &&
                   cmp(det(a.P[mid] - g, b - g)) < 0) r = mid;
                else l = mid;
            }
            else {
                if (cmp(det(a.P[l]-g, b-g)) < 0 &&
                    cmp(det(a.P[mid]-g, b-g)) >= 0) l = mid;
                else r = mid;
            }
        }
        r %= n;
        int z = cmp(det(a.P[r]-b, a.P[l]-b)) - 1;
        if (z == -2) return 1;
        return z;
    }
}
using namespace Convex;

conv Minkowski(conv C1, conv C2) {
    size_t n = C1.P.size(), m = C2.P.size();
    vector<pt> s1(n), s2(m), x;
    for (int i = 0; i < n - 1; i++) s1[i] = C1.P[i + 1] - C1.P[i];
    s1[n - 1] = C1.P[0] - C1.P[n - 1];
    for (int i = 0; i < m - 1; i++) s2[i] = C2.P[i + 1] - C2.P[i];
    s2[m - 1] = C2.P[0] - C2.P[m - 1];
    x.push_back(C1.P[0] + C2.P[0]);
    int p1 = 0, p2 = 0;
    while (p1 < n && p2 < m) {
        pt tmp = det(s1[p1],s2[p2]) >= 0 ? s1[p1++] : s2[p2++];
        x.push_back(x.back() + tmp);
    }
    while (p1 < n) x.push_back(x.back() + s1[p1++]);
    while (p2 < m) x.push_back(x.back() + s2[p2++]);
    return get_convex(x);
}

int main(int argc, const char * argv[]) {

    int a, b, c;
    scanf("%d", &a);
    vector<pt> _a(a);
    for (auto &p : _a) p.input();
    scanf("%d", &b);
    vector<pt> _b(b);
    for (auto &p : _b) p.input();
    scanf("%d", &c);
    vector<pt> _c(c);
    for (auto &p : _c) p.input();
    conv A = get_convex(_a);
    conv B = get_convex(_b);
    conv C = get_convex(_c);
    conv res = Minkowski(A, Minkowski(B, C));

    int q; scanf("%d", &q);
    while (q--) {
        pt x; x.input(); x = x * 3;
        if (containOlogn(res, x)) puts("YES");
        else puts("NO");
    }

    return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<math.h>
#include<algorithm>
#include<time.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<deque>
#include<fstream>
#include<unordered_map>
#include<bitset>
#include<cstdio>

using namespace std;

struct point {
	long long x, y;
	point(long long x, long long y)
	{
		this->x = x, this->y = y;
	}
	point()
	{
		this->x = 0, this->y = 0;
	}
	point operator-(point b)
	{
		return { this->x - b.x, this->y - b.y };
	}
	point operator+(point b)
	{
		return { this->x + b.x, this->y + b.y };
	}
};

long long dist(point a, point b)
{
	return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}

istream& operator>>(istream& in, point &a)
{
	in >> a.x >> a.y;
	return in;
}

ostream& operator<<(ostream& out, point &a)
{
	out << a.x << " " << a.y;
	return out;
}

bool operator<(point a, point b)
{
	if (a.x < b.x)
		return true;
	if (a.x == b.x && a.y < b.y)
		return true;
	return false;
}

bool operator<=(point a, point b)
{
	if (a.x < b.x)
		return true;
	if (a.x == b.x && a.y <= b.y)
		return true;
	return false;
}

struct line {
	long long a, b, c;
	line(point p1, point p2)
	{
		this->a = p1.y - p2.y;
		this->b = p2.x - p1.x;
		this->c = -1 * (a * p1.x + b * p1.y);
	}
	line(long long a, long long b, long long c)
	{
		this->a = a;
		this->b = b;
		this->c = c;
	}
	line()
	{
		this->a = 0;
		this->b = 0;
		this->c = 0;
	}
	long long sz(point p)
	{
		return this->a * p.x + this->b * p.y + this->c;
	}
};

istream& operator>>(istream& in, line &a)
{
	in >> a.a >> a.b >> a.c;
	return in;
}

point f;

bool cmp(point a, point b)
{
	line e(f, a);
	if (e.sz(b) < 0)
		return true;
	else if (e.sz(b) == 0 && dist(f, a) < dist(f, b))
		return true;
	return false;
}

long long area(vector<point> a)
{
	long long w = 0;
	for (int i = 0; i < a.size(); i++)
		w += (a[i].x + a[(i + 1) % a.size()].x) * (a[i].y - a[(i + 1) % a.size()].y);
	return w;
}

vector<point> convex_hull(vector<point> a)
{
	sort(a.begin(), a.end());
	f = a[0];
	sort(a.begin() + 1, a.end(), cmp);
	vector<point> ans;
	ans.push_back(f);
	for (int i = 0; i < a.size(); i++)
	{
		while (ans.size() >= 2 && area({ ans[ans.size() - 2], ans[ans.size() - 1], a[i] }) <= 0)
			ans.pop_back();
		ans.push_back(a[i]);
	}
	//while (ans.size() >= 2 && area({ ans[ans.size() - 2], ans[ans.size() - 1], a[0] }) >= 0)
	//	ans.pop_back();
	return ans;
}

bool pr(point a, point b, point c)
{
	if (c < b)
		swap(b, c);
	if (b <= a && a <= c)
		return true;
	return false;
}

bool polypoint(point a, vector<point> &poly)
{
	int l = 0, r = poly.size();
	while (l + 1 < r)
	{
		int m = (l + r) / 2;
		if (area({ poly[m], poly[0], a }) == 0)
		{
			if (pr(a, poly[m], poly[0]))
				return true;
			return false;
		}
		if (area({ poly[m], poly[0], a }) > 0)
			r = m;
		else
			l = m;
	}
	if (l == 0 || r == poly.size())
		return false;
	if (convex_hull({ poly[0], poly[l], poly[r], a }).size() < 4)
		return true;
	else
		return false;
}

map<point, point> we;

vector<point> mincovmn(vector<vector<point>> s, point start)
{
	vector<point> ans;
	ans.push_back(start);
	int sumsize = 0;
	for (int i = 0; i < s.size(); i++)
		reverse(s[i].begin(), s[i].end()), sumsize += s[i].size();
	for (int i = 0; i < sumsize; i++)
	{
		int vi = -1;
		point maxp;
		for (int j = 0; j < s.size(); j++)
		{
			if (s[j].size())
			{
				if (vi == -1 || area({ s[j].back(),{ 0, 0 }, maxp }) >= 0)
				{
					vi = j;
					maxp = s[j].back();
				}
			}
		}
		s[vi].pop_back();
		ans.push_back(ans.back() + maxp);
	}
	ans.pop_back();
	return ans;
}

vector<point> mincov(vector<point> s1, vector<point> s2)
{
	vector<point> ans;
	ans.push_back({ 0, 0 });
	int l1 = 0, l2 = 0;
	while (l1 < s1.size() || l2 < s2.size())
	{
		if (l1 == s1.size())
			ans.push_back(ans.back() + s2[l2++]);
		else if (l2 == s2.size())
			ans.push_back(ans.back() + s1[l1++]);
		else if (area({ s1[l1],{ 0, 0 }, s2[l2] }) >= 0)
			ans.push_back(ans.back() + s1[l1++]);
		else
			ans.push_back(ans.back() + s2[l2++]);
	}
	ans.pop_back();
	return ans;
}

vector<point> polyvector(vector<point> &poly)
{
	vector<point> poly2;
	for (int i = 0; i < poly.size(); i++)
	{
		poly2.push_back(poly[i] - poly[(i + 1) % poly.size()]);
		we[poly2.back()] = poly[(i + 1) % poly.size()];
	}
	reverse(poly2.begin(), poly2.end());
	return poly2;
}

int main() {
	//srand(time(NULL));
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	//cout.setf(ios::fixed);
	//cout.precision(1);
	vector<point> poly[3];
	vector<point> zp;
	point v[3];
	for (int i = 0; i < 3; i++)
	{
		int n;
		scanf("%d", &n);
		//cin >> n;
		for (int j = 0; j < n; j++)
		{
			point a;
			scanf("%lld%lld", &a.x, &a.y);
			//cin >> a;
			poly[i].push_back(a);
		}
		poly[i] = convex_hull(poly[i]);
		poly[i] = polyvector(poly[i]);
		v[i] = we[poly[i][0]];
	}
	int m;
	scanf("%d", &m);
	for (int i = 0; i < m; i++)
	{
		point a;
		scanf("%lld%lld", &a.x, &a.y);
		//cin >> a;
		zp.push_back(a + a + a);
	}
	vector<point> mincovski = convex_hull(mincovmn({ poly[0], poly[1], poly[2] }, v[0] + v[1] + v[2]));
	/*vector<point> mincovski = convex_hull(mincov(poly[0], poly[1]));
	for (int i = 0; i < mincovski.size(); i++)
		mincovski[i] = mincovski[i] + v[0] + v[1];
	mincovski = polyvector(mincovski);
	v[0] = we[mincovski[0]];
	mincovski = convex_hull(mincov(mincovski, poly[2]));
	for (int i = 0; i < mincovski.size(); i++)
		mincovski[i] = mincovski[i] + v[0] + v[2];*/
	for (int i = 0; i < m; i++)
	{
		if (polypoint(zp[i], mincovski))
			printf("YES\n");
		else
			printf("NO\n");
	}
}

#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#define N 200010
#define db double
#define eps (1e-6)
#define For(i,x,y) for (i=x;i<=y;i++)
using namespace std;
const db ang=0.12321312321312;
struct ww {
	db x,y;
	inline bool operator == (const ww &A) {
		return abs(x-A.x)<eps&&abs(y-A.y)<eps;
	}
	inline void read() {
		int a,b;
		scanf("%d%d",&a,&b);
		x=cos(ang)*a-sin(ang)*b;
		y=sin(ang)*a+cos(ang)*b;
		//x=a,y=b;
	}
	inline ww operator - (const ww &A) {
		return (ww){x-A.x,y-A.y};
	}
	inline ww operator + (const ww &A) {
		return (ww){x+A.x,y+A.y};
	}
	inline db operator * (const ww &A) {
		return x*A.y-y*A.x;
	}
} a[N],b[N],c[N],O;
int i,j,k,n,m,K;
inline void get(ww a[N],int n) {
	int i,k=1;
	For(i,1,n) c[i]=a[i];
	For(i,2,n) if (a[i].x<a[k].x||a[i].x==a[k].x&&a[i].y<a[k].y) k=i;
	int t=0;
	for (i=k;i<=n;i++) a[++t]=c[i];
	For(i,1,k-1) a[++t]=c[i];
	a[n+1]=a[1]; a[n+2]=a[2];
}
inline void merge(ww a[N],ww b[N]) {
	int i,j,t=0;
	get(a,n); get(b,m);
	j=1; c[t=1]=a[1]+b[1];
	For(i,1,n+1) {
		ww A=a[i+1]-a[i];
		for (;;) {
			if (t>1&&c[1]==c[t]) break;
			ww B=b[j+1]-b[j];
			db C=A*B;
			if (A*B>eps) break;
			c[++t]=a[i]+b[j+1];
			j++;
		}
		if (t>1&&c[1]==c[t]) break;
		c[++t]=a[i+1]+b[j];
	}
	For(i,1,t) a[i]=c[i];
	n=t-1;
}
inline void pre() {
	scanf("%d",&n);
	For(i,1,n) a[i].read();
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
}
inline bool pan() {
	if (O==a[1]||O==a[K]) return 1;
	if (O.x<a[1].x||O.x>a[K].x) return 0;
	int l=1,r=K,mid;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x<O.x) l=mid+1;
		else r=mid-1;
	}
	int id=l-1;
	db y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y+eps<y) return 0;

	l=K,r=n+1;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x>O.x) l=mid+1;
		else r=mid-1;
	}
	id=l-1;
	y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y-eps>y) return 0;
	return 1;
}
int main() {
	//freopen("87e.in","r",stdin);
	pre();
	For(i,1,n) if (a[i].x>a[i+1].x) break;
	K=i;
	scanf("%d",&m);
	For(i,1,m) {
		O.read();
		O.x*=3,O.y*=3;
		printf("%s\n",pan()?"YES":"NO");
	}
	return 0;
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define ler freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
#define MAXN 101010
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

int cmp(ll x, ll y = 0) {
	return (x <= y) ? (x < y) ? -1 : 0 : 1; }
struct point{
	ll x, y;
	point():x(0),y(0){}
	point(ll X, ll Y):x(X),y(Y){}
	int cmp(point a){
        if(::cmp(x,a.x))
            return ::cmp(x,a.x);
        return ::cmp(y,a.y);
    }
    point operator+(point a){ return point(x+a.x, y+a.y); }
    point operator-(point a){ return point(x-a.x, y-a.y); }
    point operator*(ll a){ return point(x*a,y*a); }
    ll operator*(point a){ return x*a.x + y*a.y; }
    ll operator%(point a){ return x*a.y - y*a.x; }
    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;

typedef vector<point> polygon;
point pivot;
bool radialcomp(point p, point q){
	point P = p-pivot, Q = q-pivot;
	ll R = P%Q;
	if(cmp(R)) return R > 0;
	return cmp(P*P,Q*Q) < 0;
}

bool comp(point a, point b){
	if((a.x > 0 || (a.x==0 && a.y>0) ) && (b.x < 0 || (b.x==0 && b.y<0))) return 1;
	if((b.x > 0 || (b.x==0 && b.y>0) ) && (a.x < 0 || (a.x==0 && a.y<0))) return 0;
	ll R = a%b;
	if(R) return R > 0;
	return 0;
}

polygon poly_sum(polygon a, polygon b){
	if(!sz(a) || !sz(b)) return polygon(0);
	pivot = *min_element(all(a));
	sort(all(a),radialcomp);
	pivot = *min_element(all(b));
	sort(all(b),radialcomp);
	polygon ret, aux;
	ret.pb(a[0]+b[0]);
	rep(i,0,sz(a)) aux.pb(a[(i+1)%sz(a)]-a[i]);
	rep(i,0,sz(b)) aux.pb(b[(i+1)%sz(b)]-b[i]);
	sort(all(aux),comp);
	rep(i,0,sz(aux)){
		point p = ret.back() + aux[i];
		while(sz(ret) > 1 && !ccw(ret[sz(ret)-2], ret[sz(ret)-1], p))
			ret.pop_back();
		ret.pb(p);
	}
	assert(ret.back() == ret[0]);
	if(sz(ret) > 1) ret.pop_back();
	return ret;
}

bool inside(point& a, point& b, point& c, point& p){
	vector<point>v;
	v.pb(a);v.pb(b);v.pb(c);v.pb(a);
	int t = 0;
	rep(i,0,3){
		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(){
	rep(k,0,3){
		point aux(2e9,2e9);
		int N, ini=-1;
		vector<point>vet;
		scanf("%d", &N);
		rep(i,0,N){
			int x, y;
			scanf("%d%d", &x, &y);
			vet.pb(point(x,y));
			if(point(x,y) < aux) aux.x=x, aux.y=y, ini=i;
		}
		rep(i,0,N) v[k].pb(vet[(i+ini)%N]);
	}
	sum = poly_sum(v[0],poly_sum(v[1],v[2]));
	n = sz(sum);
	scanf("%d", &m);
	rep(i,0,m){
		int x, y;
		scanf("%d%d", &x, &y);
		x += x+x, y += y+y;
		point p(x,y);
		if(p < sum[0]){ puts("NO"); continue; }
		if(p.x == sum[0].x){
			if(p==sum[0] || (sum.back().x==p.x && 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");
	}
}

#include <bits/stdc++.h>
using namespace std;

struct hull {
	map <int, int> points;
	long long area;
	inline hull () {
		points.clear ();
		area = 0;
	}
	inline map <int, int> :: iterator prev (map <int, int> :: iterator it) {
		return it == points.begin () ? it : --it;
	}
	inline map <int, int> :: iterator next (map <int, int> :: iterator it) {
		return it == points.end () ? it : ++it;
	}
	inline long long traparea (long long x1, long long y1, long long x2, long long y2) {
		return (x2 - x1) * (y1 + y2);
	}
	inline long long triarea (long long x1, long long y1, long long x2, long long y2, long long x3, long long y3) {
		return traparea (x1, y1, x2, y2) + traparea (x2, y2, x3, y3) + traparea (x3, y3, x1, y1);
	}
	inline long long traparea (map <int, int> :: iterator a, map <int, int> :: iterator b) {
		return traparea (a->first, a->second, b->first, b->second);
	}
	inline long long triarea (map <int, int> :: iterator it) {
		long long sum = 0;
		if (it != points.begin ()) sum += traparea (prev (it), it);
		if (next (it) != points.end ()) sum += traparea (it, next (it));
		if (it != points.begin () && next (it) != points.end ()) sum += traparea (next (it), prev (it));
		return sum;
	}
	inline bool bad(map <int, int> :: iterator it) {
		if (points.size () < 3 || it == points.begin () || next (it) == points.end ())
			return false;
		return triarea (it) <= 0;
	}
	inline void insert (int x, int y) {
		if (points.find (x) != points.end ()) {
			if (y <= points [x])
				return;
			area -= triarea (points.lower_bound (x));
			points.erase (x);
		}
		map <int, int> :: iterator it = points.insert (make_pair (x, y)).first;
		if (bad (it)) {
			points.erase (it);
			return;
		}
		area += triarea (it);
		while (bad (prev (it))) {
			area -= triarea (prev (it));
			points.erase (prev (it));
		}
		while (bad (next (it))) {
			area -= triarea (next (it));
			points.erase (next (it));
		}
	}
	inline bool contains (int x, int y) {
		map <int, int> :: iterator first = points.begin (), last = prev (points.end ());
		if (x < first->first || x > last->first)
			return false;
		if (x == first->first)
			return y <= first->second;
		if (x == last->first)
			return y <= last->second;
		map <int, int> :: iterator it = points.lower_bound (x), p = prev (it);
		int x1 = p->first, y1 = p->second, x2 = it->first, y2 = it->second;
		return (long long) (y - y1) * (x2 - x1) <= (long long) (x - x1) * (y2 - y1);
	}
};

typedef complex <int> point;
typedef vector <point> polygon;

template <typename T> inline pair <T, T> to_pair (complex <T> x) {
	return make_pair (x.real (), x.imag ());
}

inline long long cross (point a, point b) {
	return (long long) a.real () * b.imag () - (long long) b.real () * a.imag ();
}

polygon minkowski_sum (polygon a, polygon b) {
	int n = a.size (), m = b.size ();
	int aind = -1, bind = -1;
	for (int i = 0; i < n; i++)
		if (aind == -1 || to_pair (a [i]) < to_pair (a [aind]))
			aind = i;
	for (int i = 0; i < m; i++)
		if (bind == -1 || to_pair (b [i]) < to_pair (b [bind]))
			bind = i;
	polygon sum;
	sum.reserve (n + m);
	bool alooped = false, blooped = false;
	int i = aind, j = bind;
	while (!(i == aind && alooped) || !(j == bind && blooped)) {
		point pa = a [(i + 1) % n] - a [i], pb = b [(j + 1) % m] - b [j];
		if (!(i == aind && alooped) && ((j == bind && blooped) || cross (pa, pb) > 0)) {
			sum.push_back (a [i] + b [j] + pa);
			i = (i + 1) % n;
			alooped |= i == 0;
		} else {
			sum.push_back (a [i] + b [j] + pb);
			j = (j + 1) % m;
			blooped |= j == 0;
		}
	}
	return sum;
}

polygon A, B, C;

void input (polygon &P) {
	int n;
	scanf ("%d", &n);
	for (int x, y, i = 0; i < n; i++) {
		scanf ("%d %d", &x, &y);
		P.push_back (point (x, y));
	}
}

hull upper, lower;

int main () {
	input (A);
	input (B);
	input (C);
	polygon X = minkowski_sum (A, B);
	X = minkowski_sum (X, C);
	for (int i = 0; i < (int) X.size (); i++) {
		upper.insert (X [i].real (), X [i].imag ());
		lower.insert (X [i].real (), -X [i].imag ());
	}
	int M;
	scanf ("%d", &M);
	for (int x, y, i = 0; i < M; i++) {
		scanf ("%d %d", &x, &y);
		puts (upper.contains (3 * x, 3 * y) && lower.contains (3 * x, -3 * y) ? "YES" : "NO");
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(vector<vec>a,vector<vec>b){
    int i = 0, j = 0;
    for(int k = 0; k < (int)a.size(); k++)if(a[k] <a[i])
        i = k;
    for(int k = 0; k < (int)b.size(); k++)if(b[k] <b[j])
        j = k;

    vector<vec> c;
    c.reserve(a.size() + b.size());

    for(int k = 0; k < int(a.size()+b.size()); k++){
        vec pt = a[i] + b[j];
        if((int)c.size() >= 2
            && c[c.size()-2].ccw(c.back(), pt) == 0)
            c.pop_back();
        c.push_back(pt);
        int q = i+1, w = j+1;
        if(q == int(a.size())) q = 0;
        if(w == int(b.size())) w = 0;
        if(c.back().ccw(a[i]+b[w], a[q]+b[j]) == -1) i = q;
        else j = w;
    }
    c.shrink_to_fit();

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> &v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        // return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v[0]) >= 0;
    }

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <cstdio>
#include <cmath>
#include <vector>
using namespace std;
#define EPS 1e-9

struct point {
	double x, y;
	point() { x = y = 0.0; }
	point(double _x, double _y) : x(_x), y(_y) {}
	double norm(){
		return hypot(x, y);
	}
	point normalized(){
		return point(x,y)*(1.0/norm());
	}
	double angle(){ return atan2(y, x);	}
	double polarAngle(){
		double a = atan2(y, x);
		return a < 0 ? a + 2*M_PI : a;
	}
	bool operator < (point other) const {
		if (fabs(x - other.x) > EPS) return x < other.x;
		else return y < other.y;
	}
	bool operator == (point other) const {
		return (fabs(x - other.x) < EPS && (fabs(y - other.y) < EPS));
	}
	point operator +(point other) const{
		return point(x + other.x, y + other.y);
	}
	point operator -(point other) const{
		return point(x - other.x, y - other.y);
	}
	point operator *(double k) const{
		return point(x*k, y*k);
	}
};

double dist(point p1, point p2) {
	return hypot(p1.x - p2.x, p1.y - p2.y);
}

double inner(point p1, point p2) {
	return p1.x*p2.x + p1.y*p2.y;
}

double cross(point p1, point p2) {
	return p1.x*p2.y - p1.y*p2.x;
}

bool ccw(point p, point q, point r) {
	return cross(q-p, r-p) > 0;
}

bool collinear(point p, point q, point r) {
	return fabs(cross(p-q, r-p)) < EPS;
}

point rotate(point p, double rad) {
	return point(p.x * cos(rad) - p.y * sin(rad),
	p.x * sin(rad) + p.y * cos(rad));
}

double angle(point a, point o, point b) {
	return acos(inner(a-o, b-o) / (dist(o,a)*dist(o,b)));
}

point proj(point u, point v){
	return v*(inner(u,v)/inner(v,v));
}

bool between(point p, point q, point r) {
    return collinear(p, q, r) && inner(p - q, r - q) <= 0;
}

int leftmostIndex(vector<point> &P){
	int ans = 0;
	for(int i=1; i<(int)P.size(); i++){
		if (P[i] < P[ans]) ans = i;
	}
	return ans;
}

/*
 * POLYGON 2D
 */

#include <algorithm>

struct polygon{
	vector<point> P;
	polygon(){ }
	polygon(vector<point> _P) : P(_P) {
		if (!P.empty() && !(P.back() == P.front()))
			P.push_back(P[0]);
		if (signedArea() < 0.0){
			for(int i = 0; 2*i < (int)P.size(); i++){
				swap(P[i], P[P.size()-i-1]);
			}
		}
	}
	double signedArea(){
		double result = 0.0;
		for (int i = 0; i < (int)P.size()-1; i++) {
			result += cross(P[i], P[i+1]);
		}
		return result/2.0;
	}
	bool inPolygon(point p) {
		if (P.size() == 0u) return false;
		double sum = 0.0;
		for (int i = 0; i < (int)P.size()-1; i++) {
			if (ccw(p, P[i], P[i+1])) sum += angle(P[i], p, P[i+1]);
			else sum -= angle(P[i], p, P[i+1]);
		}
		return fabs(fabs(sum) - 2*M_PI) < EPS;
	}
};

polygon minkowski(polygon p1, polygon p2){
	vector<point> &A = p1.P, &B = p2.P, P;
	A.pop_back(); B.pop_back();
	int s1 = leftmostIndex(A), n1 = A.size();
	int s2 = leftmostIndex(B), n2 = B.size();
	P.push_back(A[s1]+B[s2]);
	int i=s1+1, j=s2+1, c1=0, c2=0;
	point v1, v2;
	while(c1 < n1 || c2 < n2){
		v1 = A[i]-A[(i-1+n1)%n1];
		v2 = B[j]-B[(j-1+n2)%n2];
		if (c2 == n2 || (c1 < n1 && cross(v1, v2) > 0)){
			P.push_back(P.back() + v1);
			i = (i+1)%n1; c1++;
		}
		else if (c1 == n1 || (c2 < n2 && cross(v1, v2) < 0)){
			P.push_back(P.back() + v2);
			j = (j+1)%n2; c2++;
		}
		else {
			P.push_back(P.back() + (v1+v2));
			i = (i+1)%n1; c1++;
			j = (j+1)%n2; c2++;
		}
	}
	return polygon(P);
}

/*
 * TEST MATRIX
 */

bool test(){
	int n;
	double x, y;
	vector<point> p1, p2, m;
	printf("insert polygon 1:\n");
	scanf("%d", &n);
	while(n--) {
		scanf("%lf %lf", &x, &y);
		p1.push_back(point(x, y));
	}
	printf("insert polygon 2:\n");
	scanf("%d", &n);
	while(n--) {
		scanf("%lf %lf", &x, &y);
		p2.push_back(point(x, y));
	}
	printf("minkowski sum:\n");
	m = minkowski(polygon(p1), polygon(p2)).P;
	for(int i=0; i<(int)m.size(); i++){
		printf("%.2f %.2f\n", m[i].x, m[i].y);
	}
	return true;
}

/*
 * Codeforces 87F
 */

struct triangle{
	point a, b, c;
	triangle() { a = b = c = point(); }
	triangle(point _a, point _b, point _c) : a(_a), b(_b), c(_c) {}
	int isInside(point p){
		double u = cross(b-a,p-a)*cross(b-a,c-a);
		double v = cross(c-b,p-b)*cross(c-b,a-b);
		double w = cross(a-c,p-c)*cross(a-c,b-c);
		if (u > 0.0 && v > 0.0 && w > 0.0) return 0;
		if (u < 0.0 || v < 0.0 || w < 0.0) return 2;
		else return 1;
	} //0 = inside/ 1 = border/ 2 = outside
};
int isInsideTriangle(point a, point b, point c, point p){
	return triangle(a,b,c).isInside(p);
} //0 = inside/ 1 = border/ 2 = outside
point pivot(0,0);
bool angleCmp(point a, point b){
	if (collinear(pivot, a, b)) return dist(pivot, a) < dist(pivot, b);
	double d1x = a.x-pivot.x, d1y = a.y-pivot.y;
	double d2x = b.x-pivot.x, d2y = b.y-pivot.y;
	return atan2(d1y, d1x) - atan2(d2y, d2x) < 0;
}
bool query(vector<point> &CH, point q){
	int i = 2, j = CH.size()-1, m;
	pivot = CH[1];
	while(j > i+1){
		int m = (i+j)/2;
		if (angleCmp(q, CH[m])) j = m;
		else i = m;
	}
	return isInsideTriangle(pivot, CH[i], CH[j], q) != 2;
}

void printpolygon(polygon p){
	printf("printing polygon:\n");
	for(int i=0; i<(int)p.P.size(); i++){
		printf("%.2f %.2f\n", p.P[i].x, p.P[i].y);
	}
}

int main()
{
	polygon city[3], sum;
	vector<point> P;
	double x, y;
	for(int i=0, n; i<3; i++){
		scanf("%d", &n);
		P.clear();
		while(n--){
			scanf("%lf %lf", &x, &y);
			P.push_back(point(x, y));
		}
		city[i] = polygon(P);
	}
	sum = minkowski(city[0], city[1]);
	sum = minkowski(sum, city[2]);
		//printpolygon(sum);
	P = sum.P;
	for(int i=(int)P.size()-1; i>0; i--){
		P[i] = P[i-1];
	}
	P[0] = P.back();
	//printpolygon(polygon(P));
	int m;
	scanf("%d", &m);
	while(m--){
		scanf("%lf %lf", &x, &y);
		if (query(P, point(x, y)*3.0)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cassert>
#include <cstdlib>
#include <ctime>

using namespace std;
typedef long long int64;
#define E(c) cerr<<#c
#define Eo(x) cerr<<#x<<" = "<<(x)<<endl

struct Point {
	int x, y;
	inline Point(int _x = 0, int _y = 0) : x(_x), y(_y) {}

	Point operator+ (Point b) const { return Point(x+b.x, y+b.y); }
	Point operator- (Point b) const { return Point(x-b.x, y-b.y); }
	Point operator* (int b) const { return Point(x*b, y*b); }
};

int64 vect(Point a, Point b) {
	return int64(a.x) * b.y - int64(a.y)*b.x;
}

bool LessLex(Point a, Point b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}

bool operator!= (Point a, Point b) {
	return a.x != b.x || a.y != b.y;
}

const int K = 3;
const int SIZE = 200<<10;

int n[K];
Point pts[K][SIZE];

int m;
Point qry[SIZE];

int ind[K];
int r;
Point res[SIZE];

typedef multimap<int, int>::iterator mIter;
multimap<int, int> qmap;
bool gup[SIZE], glow[SIZE];

int main() {
#ifdef HOME
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	for (int i = 0; i<K; i++) {
		scanf("%d", &n[i]);
		for (int j = 0; j<n[i]; j++)
			scanf("%d%d", &pts[i][j].x, &pts[i][j].y);
		pts[i][n[i]] = pts[i][0];
	}
	scanf("%d", &m);
	for (int i = 0; i<m; i++) scanf("%d%d", &qry[i].x, &qry[i].y);

	Point start;
	for (int i = 0; i<K; i++) {
		int best = 0;
		for (int j = 0; j<n[i]; j++)
			if (LessLex(pts[i][j], pts[i][best]))
				best = j;
		ind[i] = best;
		start = start + pts[i][best];
	}

	Point curr = start;
	do {
		res[r++] = curr;

		int chg = -1;
		Point was;
		for (int i = 0; i<K; i++) {
			Point will = pts[i][ind[i]+1] - pts[i][ind[i]];
			if (chg < 0 || vect(was, will) < 0) {
				chg = i;
				was = will;
			}
		}

		curr = curr + was;
		ind[chg]++;
		if (ind[chg] == n[chg])
			ind[chg] = 0;

	} while (curr != start);
    res[r] = res[0];

	for (int i = 0; i<m; i++) qmap.insert(make_pair(K*qry[i].x, i));

	int t = 0;
	do {
		Point left = res[t];
		Point right = res[t+1];

		if (left.x != right.x) {
			bool rev = (right.x < left.x);
			if (rev) swap(left, right);

			mIter lit = qmap.lower_bound(left.x);
			mIter rit = qmap.upper_bound(right.x);
			for (mIter it = lit; it != rit; it++) {
				Point p = qry[it->second] * K;
				int64 dx1 = int64(p.x) - int64(left.x);
				int64 dx2 = int64(right.x) - int64(left.x);
				int64 dy1 = int64(p.y) - int64(left.y);
				int64 dy2 = int64(right.y) - int64(left.y);
//				int64 pv = vect(p - left, right - left);
				int64 pv = dx1*dy2 - dy1*dx2;

				if (!rev && pv <= 0) glow[it->second] = true;
				if ( rev && pv >= 0)  gup[it->second] = true;
			}
		}

		t++;
		if (t == r) t = 0;
	} while (t != 0);

	for (int i = 0; i<m; i++) {
		if (glow[i] && gup[i]) printf("YES\n");
		else printf("NO\n");
	}

	return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define x first
#define y second

using namespace std;

typedef long long ll;

pair <ll, ll> point[5][100005];
pair <ll, ll> rebr[300005], pt[300005];

bool cmp(pair <ll, ll> A, pair <ll, ll> B)
{
    return (A.y < B.y) || (A.y == B.y && A.x < B.x);
}

ll vecs(pair <ll, ll> A, pair <ll, ll> B)
{
    return A.x * B.y - A.y * B.x;
}

ll len(pair <ll, ll> A)
{
    return A.x * A.x + A.y * A.y;
}

bool acmp(pair <ll, ll> A, pair <ll, ll> B)
{
    bool fl1 = (A.y > 0) || (A.y == 0 && A.x > 0);
    bool fl2 = (B.y > 0) || (B.y == 0 && B.x > 0);
    if (fl1 != fl2) return fl1;
    return vecs(A, B) > 0;
}

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n1, n2, n3;
    cin >> n1;
    for (int i = 1; i <= n1; i++)
    {
        cin >> point[1][i].x >> point[1][i].y;
        point[1][i + n1] = point[1][i];
    }
    cin >> n2;
    for (int i = 1; i <= n2; i++)
    {
        cin >> point[2][i].x >> point[2][i].y;
        point[2][i + n2] = point[2][i];
    }
    cin >> n3;
    for (int i = 1; i <= n3; i++)
    {
        cin >> point[3][i].x >> point[3][i].y;
        point[3][i + n3] = point[3][i];
    }

    int pos1 = 1, pos2 = 1, pos3 = 1;
    for (int i = 1; i <= n1; i++) if (cmp(point[1][i], point[1][pos1])) pos1 = i;
    for (int i = 1; i <= n2; i++) if (cmp(point[2][i], point[2][pos2])) pos2 = i;
    for (int i = 1; i <= n3; i++) if (cmp(point[3][i], point[3][pos3])) pos3 = i;

    pair <ll, ll> S = mp(point[1][pos1].x + point[2][pos2].x + point[3][pos3].x, point[1][pos1].y + point[2][pos2].y + point[3][pos3].y);
    int sch = 0;
    for (int i = pos1; i < n1 + pos1; i++)
    {
        sch++;
        rebr[sch] = mp(point[1][i + 1].x - point[1][i].x, point[1][i + 1].y - point[1][i].y);
    }
    for (int i = pos2; i < n2 + pos2; i++)
    {
        sch++;
        rebr[sch] = mp(point[2][i + 1].x - point[2][i].x, point[2][i + 1].y - point[2][i].y);
    }
    for (int i = pos3; i < n3 + pos3; i++)
    {
        sch++;
        rebr[sch] = mp(point[3][i + 1].x - point[3][i].x, point[3][i + 1].y - point[3][i].y);
    }
    sort(rebr + 1, rebr + sch + 1, acmp);

    pt[1] = S;
    ll last = pt[1].x;
    for (int i = 1; i <= sch; i++)
    {
        pt[i + 1] = mp(pt[i].x + rebr[i].x, pt[i].y + rebr[i].y);
        if (pt[i + 1].y == pt[1].y) last = max(last, pt[i + 1].x);
    }

    int quer;
    cin >> quer;
    for (int rep = 1; rep <= quer; rep++)
    {
        pair <ll, ll> A;
        cin >> A.x >> A.y;
        A.x *= 3, A.y *= 3;
        if (A.y < pt[1].y) {cout << "NO\n"; continue;}
        if (A.y == pt[1].y)
        {
            if (pt[1].x <= A.x && A.x <= last) {cout << "YES\n"; continue;}
            else {cout << "NO\n"; continue;}
        }
        pair <ll, ll> M = mp(A.x - pt[1].x, A.y - pt[1].y);
        int lef = 1, rig = sch + 1;
        while (lef + 1 < rig)
        {
            int mid = (lef + rig) / 2;
            pair <ll, ll> T = mp(pt[mid].x - pt[1].x, pt[mid].y - pt[1].y);
            if (vecs(T, M) > 0) lef = mid;
            else rig = mid;
        }
        if (lef == 1)
        {
            pair <ll, ll> T = mp(pt[2].x - pt[1].x, pt[2].y - pt[1].y);
            if (vecs(T, M) == 0 && len(T) >= len(M)) cout << "YES\n";
            else cout << "NO\n";
            continue;
        }
        if (rig == sch + 1) {cout << "NO\n"; continue;}
        pair <ll, ll> P = mp(A.x - pt[lef].x, A.y - pt[lef].y);
        pair <ll, ll> Q = mp(pt[rig].x - pt[lef].x, pt[rig].y - pt[lef].y);
        if (vecs(Q, P) < 0) cout << "NO\n";
        else cout << "YES\n";
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;

#define REP(i, n) for (int i = 0, _n = (n); i < _n; ++i)
#define FOR(i, a, b) for (int i = (a), _n = (b); i <= _n; ++i)
#define FORD(i, a, b) for (int i = (a), _n = (b); i >= _n; --i)
#define FORE(it, c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define PB push_back
#define MP make_pair
#define FI first
#define SE second

typedef long long LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

const int INF = 1000000000;

const int NMAX = 50000;

struct point {
	int x, y;
	point() { }
	point(int x, int y): x(x), y(y) { }
	point& operator +=(const point& rhs) {
		x += rhs.x;
		y += rhs.y;
		return *this;
	}
	point& operator *=(int t) {
		x *= t;
		y *= t;
		return *this;
	}
};
inline point operator +(const point& p1, const point& p2) {
	return point(p1.x+p2.x, p1.y+p2.y);
}
inline point operator -(const point& p1, const point& p2) {
	return point(p1.x-p2.x, p1.y-p2.y);
}
inline LL cross(const point& p1, const point& p2) {
	return 1LL*p1.x*p2.y - 1LL*p1.y*p2.x;
}
inline LL cross(const point& p0, const point& p1, const point& p2) {
	return cross(p1-p0, p2-p0);
}
enum { LEFT, RIGHT, STRAIGHT };
inline int ccw(const point& p0, const point& p1, const point& p2) {
	LL res = cross(p0, p1, p2);
	return res > 0 ? LEFT : (res < 0 ? RIGHT : STRAIGHT);
}
inline bool operator <(const point& p1, const point& p2) {
	bool small1 = p1.y > 0 || (p1.y == 0 && p1.x > 0),
		small2 = p2.y > 0 || (p2.y == 0 && p2.x > 0);
	if (small1 != small2) return small1;
	return cross(p1, p2) > 0;
}

int NS;
point sides[3*NMAX], T[3*NMAX];

bool in_polygon(const point& P) {
//printf("in_polygon(%d, %d)\n", P.x, P.y);
	int left = 1, right = NS-1;
	if (ccw(T[0], T[1], P) == RIGHT || ccw(T[0], T[NS-1], P) == LEFT)
		return false;
	while (left+1 < right) {
		int mid = (left+right)/2;
		if (ccw(T[0], T[mid], P) == LEFT)
			left = mid;
		else right = mid;
	}
//printf("left=%d right=%d, T[left]=(%d, %d), T[right]=(%d, %d), P=(%d, %d)\n", left, right, T[left].x, T[left].y, T[right].x, T[right].y, P.x, P.y);
	return ccw(T[left], T[right], P) != RIGHT;
}

int main() {
	point pmin(0, 0);
	REP(i, 3) {
		int N;
		point p0, pcurmin, pcur, pnext;
		scanf("%d%d%d", &N, &p0.x, &p0.y);
		pcurmin = pcur = p0;
		REP(j, N-1) {
			scanf("%d%d", &pnext.x, &pnext.y);
			if (pnext.y < pcurmin.y || (pnext.y == pcurmin.y && pnext.x < pcurmin.x))
				pcurmin = pnext;
			sides[NS++] = pnext-pcur;
			pcur = pnext;
		}
		sides[NS++] = p0-pcur;
		pmin += pcurmin;
	}

	sort(sides, sides+NS);
//REP(i, NS) printf("(%d %d)\n", sides[i].x, sides[i].y);
	T[0] = pmin;
	FOR(i, 1, NS-1) T[i] = T[i-1] + sides[i-1];
	int pr = NS-1, cur = 0, ne = 1, ind = 0;
	do {
		if (ccw(T[pr], T[cur], T[ne]) != STRAIGHT) {
			T[ind++] = T[cur];
			pr = cur;
		}
		cur = ne;
		ne = (ne < NS-1 ? ne+1 : 0);
	} while (cur != 0);
	NS = ind;

//REP(i, NS) printf("(%d, %d)\n", T[i].x, T[i].y);

	int M;
	scanf("%d", &M);
	REP(i, M) {
		point P;
		scanf("%d%d", &P.x, &P.y);
		P *= 3;
		printf("%s\n", in_polygon(P) ? "YES" : "NO");
	}
}

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef long long ll;

pii operator+(const pii& a,const pii& b) { return pii(a.first+b.first,a.second+b.second); }
pii operator-(const pii& a,const pii& b) { return pii(a.first-b.first,a.second-b.second); }

ll productVect(const pii& a,const pii& b)
{
	ll A = a.first;
	ll B = a.second;
	ll C = b.first;
	ll D = b.second;
	return A*D-B*C;
}

bool pii_comp_x( const pii& a,const pii &b)
{
	return a.first < b.first;
}

int inChain(const vpii& up,const vpii& dn, const pii& pnt)
{
	if (pnt.first < up[0].first) return 0;
	if (pnt.first > up.back().first) return 0;
	int i = lower_bound(up.begin(),up.end(),pnt,pii_comp_x)-up.begin();
	int j = lower_bound(dn.begin(),dn.end(),pnt,pii_comp_x)-dn.begin();
	int u = up.size();
	int d = dn.size();
	if ( i > 0 ) i--;
	if ( j > 0 ) j--;
	/*
	printf("pick %d,%d - %d,%d\n",up[i].first,up[i].second,up[i+1].first,up[i+1].second);
	printf("pick %d,%d - %d,%d\n",dn[i].first,dn[i].second,dn[i+1].first,dn[i+1].second);
	*/
	if ( productVect(up[i+1]-up[i], pnt-up[i]) > 0) return 0;
	if ( productVect(dn[j+1]-dn[j], pnt-dn[j]) < 0) return 0;
	return 1;
}

void convex_minko_sum(const vpii& a, const vpii& b, vpii& out)
{
	out.clear();
	int i=0,j=0;
	for (int q=0;q<a.size();++q) if (a[q]<a[i]) i=q;
	for (int q=0;q<b.size();++q) if (b[q]<b[j]) j=q;
	do
	{
		out.push_back( a[i]+b[j] );
		ll pro= productVect(a[(i+1)%a.size()]-a[i], b[(j+1)%b.size()]-b[j]);
		if (pro>=0)	i=(i+1)%a.size();
		if (pro<=0)	j=(j+1)%b.size();
	}
	while ( a[i]+b[j] != out[0] );
}

int main()
{
	vpii T[5];
	for (int q=0;q<3;++q)
	{
		int sz;
		scanf("%d",&sz);
		for (int w=0;w<sz;++w)
		{
			pii u;
			scanf("%d %d",&u.first,&u.second);
			T[q].push_back(u);
		}
	}
	convex_minko_sum( T[0],T[1],T[3]);
	convex_minko_sum( T[2],T[3],T[4]);

	vpii up,down;// up - x is decreasing, down - x is increasing
	for (int q=0;q<T[4].size();++q)
	{
		pii a = T[4][q];
		pii b = T[4][(q+1)%T[4].size()];
		if (a.first < b.first) //go down!
		{
			if (down.empty() || down.back()!=a) down.push_back(a);
			down.push_back(b);
		}
		if (a.first > b.first) // go up!
		{
			if (up.empty() || up.back()!=a) up.push_back(a);
			up.push_back(b);
		}
	}
	reverse(up.begin(),up.end());

	//for (int q=0;q<up.size();++q) printf("%d,%d ",up[q].first,up[q].second); printf("\n");
	//for (int q=0;q<down.size();++q) printf("%d,%d ",down[q].first,down[q].second); printf("\n");

	int Quest;
	scanf("%d",&Quest);
	for (int q=0;q<Quest;++q)
	{
		pii u;
		scanf("%d %d",&u.first,&u.second); u.first*=3; u.second*=3;
		printf("%s\n",inChain(up,down,u)?"YES":"NO");
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define double long double

struct Point
{
    int x, y;
    Point(int x2 = 0, int y2 = 0) {
        x = x2; y = y2;
    }
};

struct Vector
{
    int x, y;
    Vector(Point a = {0, 0}, Point b = {0, 0}) {
        x = b.x - a.x;
        y = b.y - a.y;
    }

    int len() {
        return x * x + y * y;
    }
};

istream& operator>>(istream &in, Point &p) {
    in >> p.x >> p.y;
    return in;
}

ostream& operator<<(ostream &out, Point &p) {
    out << p.x << " " << p.y;
    return out;
}

ostream& operator<<(ostream &out, Vector &v) {
    out << v.x << " " << v.y;
    return out;
}

int cross(const Vector &v1, const Vector &v2) {
    double x1 = v1.x, y1 = v1.y;
    double x2 = v2.x, y2 = v2.y;
    if (x1 * y2 == y1 * x2) {
        return 0;
    }
    if (x1 * y2 > y1 * x2) {
        return 1;
    }
    if (x1 * y2 < y1 * x2) {
        return -1;
    }
}

Point operator+(Point p, Vector v) {
    Point ans = p;
    ans.x += v.x;
    ans.y += v.y;
    return ans;
}

Vector operator+(Vector v1, Vector v2) {
    Vector ans = Vector();
    ans.x += v1.x + v2.x;
    ans.y += v1.y + v2.y;
    return ans;
}

bool operator==(const Point &a, const Point &b) {
    return a.x == b.x && a.y == b.y;
}

bool point_in_angle(const Point &a, const Point &b, const Point &c, const Point &p) {
    return cross(Vector(b, p), Vector(b, a)) * cross(Vector(b, p), Vector(b, c)) <= 0 || b == p;
}

bool point_in_cpoly(const vector<Point> &poly, const Point &p) {
    int n = poly.size();
    if (!point_in_angle(poly[n - 1], poly[0], poly[1], p)) {
        return false;
    }
    int l = 1, r = n - 1;
    while (r - l > 1) {
        // cout << l << " " << r << endl;
        int m = (l + r) / 2;
        if (point_in_angle(poly[l], poly[0], poly[m], p)) {
            r = m;
        } else {
            l = m;
        }
    }
    // cout << l << " " << r << endl;
    return point_in_angle(poly[0], poly[r], poly[l], p) && point_in_angle(poly[r], poly[l], poly[0], p);
}

int64_t len(Vector v) {
    return v.x * v.x + v.y * v.y;
}

bool cmp(const Vector &a, const Vector &b) {
    if (a.y <= 0 && b.y > 0) {
        return false;
    }
    if (a.y > 0 && b.y <= 0) {
        return true;
    }
    if (a.y == 0 && b.y == 0) {
        return a.x < b.x;
    }
    if (cross(a, b) > 0) {
        return true;
    } else if (cross(a, b) == 0) {
        return len(a) < len(b);
    }
    return false;
}

main() {
    int n = 0;
    vector<Vector> al;
    Point p0 = Point(0, 0);
    for (int num = 0; num < 3; ++num) {
        int k;
        cin >> k;
        n += k;
        vector<Point> poly(k);
        Point min_p = Point(1e9, 1e9);
        for (int i = 0; i < k; ++i) {
            cin >> poly[i];
            if (poly[i].y < min_p.y) {
                min_p = poly[i];
            } else if (poly[i].y == min_p.y) {
                if (poly[i].x > min_p.x) {
                    min_p = poly[i];
                }
            }
        }
        p0.x += min_p.x;
        p0.y += min_p.y;
        for (int i = 0; i < k; ++i) {
            Vector v = Vector(poly[i], poly[(i + 1) % k]);
            al.push_back(v);
        }
    }
    sort(al.begin(), al.end(), cmp);
    vector<Vector> al2;
    al2.push_back(al[0]);
    for (int i = 1; i < n; ++i) {
        // cout << al[i] << endl;
        int k = al2.size();
        if (cross(al2[k - 1], al[i]) == 0) {
            al2[k - 1] = al2[k - 1] + al[i];
        } else {
            // cout << i << endl;
            al2.push_back(al[i]);
        }
    }
    n = al2.size();
    /*for (int i = 0; i < n; ++i) {
        cout << al2[i] << endl;
    }*/
    vector<Point> poly(n);
    poly[0] = p0;
    // cout << p0 << endl;
    for (int i = 1; i < n; ++i) {
        poly[i] = poly[i - 1] + al2[i - 1];
        // cout << poly[i] << endl;
    }
    assert(poly[n - 1] + al2[n - 1] == p0);
    int k;
    cin >> k;
    for (int i = 0; i < k; ++i) {
        Point p;
        cin >> p;
        p.x *= 3;
        p.y *= 3;
        if (point_in_cpoly(poly, p)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    // cout << point_in_angle(poly[n - 1], poly[0], poly[1], Point(3, -1));
    // cout << point_in_angle(poly[9], poly[8], poly[0], Point(0, 2));
    return 0;
}

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ab(x) ((x) < 0 ? -(x) : (x))
using namespace std;
typedef long long LL;
typedef map<int, int>::iterator mit;
typedef pair<int, int> pii;
typedef set<pii>::iterator sit;
#define x first
#define y second
const int N = 2e5 + 10;
int n;
pii a[N], b[N];
pii operator + (const pii &a, const pii &b) { return mp(a.x + b.x, a.y + b.y); }
pii operator - (const pii &a, const pii &b) { return mp(a.x - b.x, a.y - b.y); }
LL operator * (const pii &a, const pii &b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
void shift( pii a[], int n ) { rotate(a + 1, max_element(a + 1, a + n + 1), a + n + 1); }

pii c[N]; int cl;
void merge(pii a[], pii b[], int &la, int lb) {
	c[ cl = 1 ] = a[1] + b[1];
	for(int i = 1, j = 1;;) {
		pii A = a[i % la + 1] - a[i], B = b[j % lb + 1] - b[j], y;
		if (A * B >= 0) {
			i = i % la + 1, y = a[i] + b[j];
		} else {
			j = j % lb + 1, y = a[i] + b[j];
		}
		if (cl >= 2 && (y - c[cl]) * (c[cl] - c[cl - 1]) == 0) cl--;
		c[++cl] = y;
		if (i == 1 && j == 1) break;
	}
	cl--, la = cl; memcpy(a + 1, c + 1, cl * sizeof(c[0]));
}
int m;
set<pii> t1, t2;
void init() {
	int ed = min_element(a + 1, a + m + 1) - a;
	rep(i,1,ed - 1) t1.insert(a[i]); if (ed == 1 || a[ed - 1].x != a[ed].x) t1.insert(a[ed]);
	rep(i,ed,m) t2.insert(mp(a[i].x, -a[i].y)); if (a[m].x != a[1].x) t2.insert(mp(a[1].x, -a[1].y));
}

const int inf = 2e9;
inline bool chk(set<pii> &s, int x, int y) {
	sit it = s.lower_bound(mp(x, -inf));
	if (it == s.end()) return false;
	if (it->x == x) return it->y >= y;
	if (it == s.begin()) return false;
	sit t = it; t--;
	pii L = *t, R = *it, cur = mp(x, y);
	if ((cur - L) * (R - L) >= 0) return true; else return false;
}

bool check(int x, int y) {
	if (chk(t1, x, y) && chk(t2, x, -y)) return true; else return false;
}

int main() {
	scanf("%d",&m);
	rep(i,1,m) scanf("%d%d",&a[i].x,&a[i].y);
	shift(a, m);

	Rep(t,2) {
		int n; scanf("%d",&n);
		rep(i,1,n) scanf("%d%d",&b[i].x,&b[i].y);
		shift(b, n);

		merge(a, b, m, n);
	}

	init();
	int q; scanf("%d",&q);
	rep(i,1,q) {
		int x, y; scanf("%d%d",&x,&y);
		if (check(x * 3, y * 3)) printf("YES\n"); else printf("NO\n");
	}
	return 0;
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
typedef pair<long long ,long long> pll;
vector< pll > p[4];
int st[4],mid_pos[4],pos[4];

pll operator +(const pll &a,const pll &b)
{
    return make_pair(a.first+b.first,a.second+b.second);
}

pll operator -(const pll &a,const pll &b)
{
    return make_pair(a.first-b.first,a.second-b.second);
}

void out(pll a)
{
    cout<<a.first<<'\t'<<a.second<<endl;
}

bool cmp(pll a,pll b)
{
    return a.first*b.second-a.second*b.first>0;
}
void cal_st(int idx)
{
    st[idx]=0;
    for(int i=1;i<p[idx].size();i++)
        if(p[idx][i]<p[idx][st[idx]])
            st[idx]=i;
}
void cal_mid_pos(int idx)
{
    mid_pos[idx]=0;
    for(int i=1;i<p[idx].size();i++)
        if(p[idx][i]>p[idx][mid_pos[idx]])
            mid_pos[idx]=i;
}
int cal_next(int idx)
{
    int ans=pos[idx]+1;
    if(ans==p[idx].size())
        ans=0;
    return ans;
}

int bs1(int start,int num,pll a)
{
    int l=0,r=num-1,mid;
    while(l<r){
        mid=(l+r)/2;
        if(p[3][(start+mid+1)%p[3].size()]<=a)
            l=mid+1;
        else
            r=mid;
    }
    return (l+start)%p[3].size();
}

int bs2(int start,int num,pll a)
{
    int l=0,r=num-1,mid;
    while(l<r){
        mid=(l+r)/2;
        if(p[3][(start+mid+1)%p[3].size()]>=a)
            l=mid+1;
        else
            r=mid;
    }
    return (l+start)%p[3].size();
}

bool judge(pll a)
{
    int idx;
    if(a==p[3][st[3]]||a==p[3][mid_pos[3]])
        return true;
    if(a<p[3][st[3]]||a>p[3][mid_pos[3]])
        return false;

    if(st[3]<mid_pos[3])
        idx=bs1(st[3],mid_pos[3]-st[3],a);
    else
        idx=bs1(st[3],mid_pos[3]+p[3].size()-st[3],a);
    pos[3]=idx;
    if(cmp(a-p[3][idx],p[3][cal_next(3)]-p[3][idx]))
        return false;

    if(mid_pos[3]<st[3])
        idx=bs2(mid_pos[3],st[3]-mid_pos[3],a);
    else
        idx=bs2(mid_pos[3],st[3]+p[3].size()-mid_pos[3],a);
    pos[3]=idx;
    if(cmp(a-p[3][idx],p[3][cal_next(3)]-p[3][idx]))
        return false;
    return true;
}

int main()
{
    //freopen("e.txt","r",stdin);
    //freopen("eans.txt","w",stdout);
    int num,x,y,next,idx;
    pll tmp;
    for(int i=0;i<3;i++){
        scanf("%d",&num);
        p[i].clear();
        for(int j=0;j<num;j++){
            scanf("%d%d",&x,&y);
            p[i].push_back(make_pair(x,y));
        }
        cal_st(i);
        cal_mid_pos(i);
    }
    p[3].clear();
    p[3].push_back(make_pair(0,0));
    for(int i=0;i<3;i++){
        pos[i]=st[i];
        p[3][0]=p[3][0]+p[i][st[i]];
    }
    while(1){
        idx=0;
        for(int i=1;i<3;i++)
            if(cmp(p[i][cal_next(i)]-p[i][pos[i]],p[idx][cal_next(idx)]-p[idx][pos[idx]]))
                idx=i;
        pos[idx]=cal_next(idx);
        tmp=make_pair(0,0);
        for(int i=0;i<3;i++)
            tmp=tmp+p[i][pos[i]];
        if(tmp==p[3][0])
            break;
        p[3].push_back(tmp);
    }
    cal_st(3);
    cal_mid_pos(3);
    scanf("%d",&num);
    while(num--){
        scanf("%d%d",&x,&y);
        tmp=make_pair(x*3,y*3);
        if(judge(tmp))
            puts("YES");
        else
            puts("NO");
    }
    //while(1);
    return 0;
}

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <array>
using namespace std;

#ifdef _LOCAL_
#define LLD "%lld"
#else
#define LLD "%I64d"
#endif

#define prev pppppppprev
#define next nnnnnnnnext

#ifdef _LOCAL_
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define DB(args...) DBin(#args, args)
#define DBcont(cont) cerr<<__LINE__<<": "<<#cont<<" = ", print_cont(cont)
#else
#define eprintf(...) static_cast<void>(0)
#define DB(args...) static_cast<void>(0)
#define DBcont(cont) static_cast<void>(0)
#endif
void DBcontinue() {}
template <typename T, typename... Args>
void DBcontinue(T head, Args... tail)
{
    char *head_name = strtok(NULL, ", ");
    cerr << "," << string(head_name) << "=" << head;
    DBcontinue(tail...);
}
template <typename T, typename... Args>
void DBin(const char *names, T head, Args... tail)
{
    char *names_buf = new char[strlen(names) + 1];
    strcpy(names_buf, names);
    char *head_name = strtok(names_buf, ", ");
    cerr << __LINE__ << ": " << string(head_name) << "=" << head;
    DBcontinue(tail...);
    cerr << "\n";
    delete[] names_buf;
}
template <class Container>
void print_cont(const Container &cont)
{
    cerr << "{ ";
    for(auto it = begin(cont); it != end(cont); ++it)
    {
        if(it != begin(cont))
            cerr << ", ";
        cerr << *it;
    }
    cerr << " }\n";
}

#define rep(x,y,z) for (int x = (y), e##x = (z);x < e##x; x++)
typedef long long ll;
typedef pair<int,int> pii;

struct v2ll
{
    ll x,y;
    v2ll operator +(const v2ll &v) const
    {
        return {x + v.x, y + v.y};
    }
    v2ll operator -(const v2ll &v) const
    {
        return {x - v.x, y - v.y};
    }
    v2ll operator *(const ll &t) const
    {
        return {t * x, t * y};
    }
    ll operator *(const v2ll &v) const
    {
        return x * v.x + y * v.y;
    }
    ll operator ^(const v2ll &v) const
    {
        return x * v.y - y * v.x;
    }
    bool operator ==(const v2ll &v) const
    {
        return x == v.x && y == v.y;
    }
    void scan()
    {
        scanf(LLD, &x);
        scanf(LLD, &y);
    }
    friend istream& operator >>(istream &in, v2ll &v);
    friend ostream& operator <<(ostream &out, const v2ll &v);
};
istream& operator >>(istream &in, v2ll &v)
{
    in >> v.x >> v.y;
    return in;
}
ostream& operator <<(ostream &out, const v2ll &v)
{
    out << (v.x) << " " << (v.y);
    return out;
}

/*void remove_ints(vector<v2ll> &A)
{
    int n = A.size(), nn = 0, i = 0, pi = n - 1, ni = 1;
    for(int processed = 0; processed < n;)
    {
        for(; ((A[ni] - A[i]) ^ (A[pi] - A[i])) == 0; pi = i, i = ni, ni = (i + 1) % n, ++processed);
        A[nn++] = A[i];
    }
}*/
vector<v2ll> minkowski_sum(const vector<v2ll> &A, const vector<v2ll> &B)
{
    int nA = A.size(), nB = B.size(), i, ni, j, nj;
    auto cmp_coords = [](const v2ll&a, const v2ll&b) {return (a.x < b.x || a.x == b.x && a.y < b.y);};
    i = min_element(A.begin(), A.end(), cmp_coords) - A.begin();
    ni = (i + 1) % nA;
    j = min_element(B.begin(), B.end(), cmp_coords) - B.begin();
    nj = (j + 1) %nB;
    vector<v2ll> ret;
    //v2ll dir = {-1,0};
    do
    {
        ret.push_back(A[i] + B[j]);
        ll cr = ((A[ni] - A[i]) ^ (B[nj] - B[j]));
        if(cr > 0)
            i = ni, ni = (i + 1) % nA;
        else if(cr < 0)
            j = nj, nj = (j + 1) % nB;
        else
        {
            i = ni, ni = (i + 1) % nA;
            j = nj, nj = (j + 1) % nB;
        }
    } while(!(A[i] + B[j] == ret[0]));
    return ret;
}
bool in_convex_polygon(const v2ll &P, const vector<v2ll> &A)
{
    int n = A.size();
    if(P == A[0])
        return true;
    if( ((A[0] - A[n-1]) ^ (P - A[0])) < 0 ||
            ((A[1] - A[0]) ^ (P - A[0])) < 0 )
        return false;
    int i = lower_bound( A.begin() + 1, A.end(), P, [&](const v2ll &a, const v2ll &b)
                                                        {
                                                            return ((a - A[0]) ^ (b - A[0])) > 0;
                                                        } ) - A.begin();
    DB(i);
    if( ((P - A[0]) ^ (A[i] - A[0])) == 0 )
        return ((A[0] - P) * (A[i] - P)) <= 0;
    return ((A[i] - A[i-1]) ^ (P - A[i])) >= 0;
}

void run()
{
    vector<v2ll> A[3], S;
    v2ll P;
    for(int ip = 0; ip < 3; ++ip)
    {
        int n;
        scanf("%d", &n);
        for(int i = 0; i < n; ++i)
        {
            P.scan();
            A[ip].push_back(P);
        }
    }
    S = minkowski_sum(A[0], A[1]);
    DBcont(S);
    S = minkowski_sum(S, A[2]);
    DBcont(S);
    int m;
    scanf("%d", &m);
    for(int i = 0; i < m; ++i)
    {
        P.scan();
        P = P * 3;
        puts(in_convex_polygon(P, S) ? "YES" : "NO");
    }
}

//#define file_name "barduck"

int main()
{
#ifdef _LOCAL_
    if(freopen("input.txt", "r", stdin) == NULL)
    {
        printf("Can't open input.txt\n");
        return 0;
    }
#else
#ifdef file_name
    freopen(file_name".in", "r", stdin);
    freopen(file_name".out", "w", stdout);
#endif
#endif
    run();
#ifdef _LOCAL_
    //puts("================");
#endif

    return 0;
}

#define local
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

#ifdef local
    #define inf cin
    #define outf cout
#endif

struct point
{
    long long x, y;
};

const long long MAXN = 50000;
const long long MAXM = 100000;
const long long INF = 2000000000;

long long N[3];
long long M;
point hill;
point city[3][MAXN];
point down_left[3];
point edges[3][MAXN];
vector< pair<double, pair<long long, long long> > > my_atan2[3];
point poly[3*MAXN];

const double eps = 1e-9;
bool compi(double a, double b)
{
  return (a < b-eps);
}

double myatan2(long long y, long long x)
{
    double res;
    res = atan2(y, x);
    if (res < 0) res += 2*M_PI;
    return res;
}

bool clockwise(point p1, point p2, point p3)
{
    if ((p1.x-p3.x)*(p2.y-p3.y)+(p2.x-p3.x)*(p3.y-p1.y) <= 0) return true;
    return false;
}

int main()
{
    for (long long k = 0; k < 3; k++)
    {
        inf >> N[k];
        down_left[k].y = (long long)INF;
        for (long long i = 0; i < N[k]; i++)
        {
            inf >> city[k][i].x >> city[k][i].y;
            if (city[k][i].y < down_left[k].y)
                down_left[k] = city[k][i];
            else if (city[k][i].y == down_left[k].y)
                if (city[k][i].x < down_left[k].x)
                    down_left[k] = city[k][i];
        }
        my_atan2[k].resize(N[k]);
        for (long long i = 0; i < N[k]; i++)
        {
            edges[k][i].x = city[k][(i+1)%N[k]].x-city[k][i].x;
            edges[k][i].y = city[k][(i+1)%N[k]].y-city[k][i].y;
            my_atan2[k][i].first = atan2((double)edges[k][i].y, (double)edges[k][i].x);
            if (my_atan2[k][i].first < 0) my_atan2[k][i].first += 2*M_PI;
            my_atan2[k][i].second.first = k;
            my_atan2[k][i].second.second = i;
        }
    }

    sort(my_atan2[0].begin(), my_atan2[0].end());
    sort(my_atan2[1].begin(), my_atan2[1].end());
    sort(my_atan2[2].begin(), my_atan2[2].end());
    vector< pair<double, pair<long long, long long> > > tmp(N[0]+N[1]), eds(N[0]+N[1]+N[2]);
    merge(my_atan2[0].begin(), my_atan2[0].end(), my_atan2[1].begin(), my_atan2[1].end(), tmp.begin());
    merge(tmp.begin(), tmp.end(), my_atan2[2].begin(), my_atan2[2].end(), eds.begin());

    for (long long i = 0; i < 3; i++)
        poly[0].x += down_left[i].x,
        poly[0].y += down_left[i].y;
    //cout << poly[0].x << " " << poly[0].y << endl;
    for (long long i = 1; i < N[0]+N[1]+N[2]; i++)
    {
        poly[i].x = poly[i-1].x + edges[eds[i-1].second.first][eds[i-1].second.second].x,
        poly[i].y = poly[i-1].y + edges[eds[i-1].second.first][eds[i-1].second.second].y;
        //cout << poly[i].x << " " << poly[i].y << endl;
    }
    inf >> M;
    vector<double> ang(eds.size());
    ang[0] = 0;
    for (long long i = 1; i < ang.size(); i++)
    {
        ang[i] = myatan2(poly[i].y-poly[0].y, poly[i].x-poly[0].x);
    }

    int last_zero = 1;
    while (ang[last_zero] >= ang[last_zero+1]-eps && ang[last_zero] <= ang[last_zero+1]+eps) last_zero++;
    point zero;
    zero.x = poly[last_zero].x-poly[0].x; zero.y = poly[last_zero].y-poly[0].y;
    for (long long i = 0; i < M; i++)
    {
        inf >> hill.x >> hill.y;
        hill.x *= 3; hill.y *= 3;
        vector<double>::iterator iter;
        point pt;
        pt.x = hill.x-poly[0].x; pt.y = hill.y-poly[0].y;
        double tang = myatan2(pt.y,pt.x);
        int sz = ang.size();
        iter = lower_bound(ang.begin(), ang.end(), tang, compi);
        if (iter == ang.end())
        {
            outf << "NO\n";
            continue;
        }
        int pos = iter-ang.begin();
        if (tang >= ang[1]-eps && tang <= ang[1]+eps)
        {
            if (((pt.x >= 0 && pt.x <= zero.x)||(pt.x <= 0 && pt.x >= zero.x))
                 &&
                 ((pt.y >= 0 && pt.y <= zero.y)||(pt.y <= 0 && pt.y >= zero.y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        } else
        if (ang[pos] >= ang[ang.size()-1]-eps && ang[pos] <= ang[ang.size()-1]+eps)
        {
            if (((hill.x >= poly[0].x && hill.x <= poly[pos].x)||(hill.x <= poly[0].x && hill.x >= poly[pos].x))
                 &&
                 ((hill.y >= poly[0].y && hill.y <= poly[pos].y)||(hill.y <= poly[0].y && hill.y >= poly[pos].y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        }
        if (clockwise(poly[(pos-1)%sz], hill, poly[pos]))
            outf << "YES\n"; else outf << "NO\n";

    }
}

#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <memory.h>
#include <cstdio>
#include <assert.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define mp make_pair
#define X first
#define Y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> pii;

pii operator- ( const pii &a, const pii &b)
{
    pii res = a;

    res.X -= b.X;
    res.Y -= b.Y;

    return res;
}

pii operator+ ( const pii &a, const pii &b)
{
    pii res = a;

    res.X += b.X;
    res.Y += b.Y;

    return res;
}

bool cmp_by_angle( const pii &a, const pii &b)
{
    if(!a.X && !a.Y) return false;
    if(!b.X && !b.Y) return false;

    return atan2(-a.X,a.Y) < atan2(-b.X,b.Y);
}

bool cmp_angle(const pii &a, const pii &b)
{
    if (a.X == 0 && b.X == 0)
		return a.Y < b.Y;
	return a.Y * 1ll * b.X < a.X * 1ll * b.Y;
}

inline ll sqeare(const pii &a, const pii &b, const pii &c)
{
    return 1LL*(b.X-a.X)*(c.Y-a.Y) - 1LL*(b.Y-a.Y)*(c.X-a.X);
}

int main()
{
	#ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    vector<pii> points[3];

    pii check = mp(-INF,-INF);

    rep(i,3)
    {
        int N;
        cin >> N;

        points[i].clear();

        rep(k,N)
        {
            int x,y;

            cin >> x >> y;

            if(check.X == -INF) check = mp(x,y);

            points[i].pb(mp(x,y));
        }
    }

    vector<pii> edges;

    rep(k,3)
    {
        const int N = points[k].size();

        rep(i,N)
        {
            if(points[k][(i+1)%N] == points[k][i]) continue;

            edges.pb( points[k][(i+1)%N] - points[k][i] );
        }
    }

    sort(all(edges), &cmp_by_angle);

    vector<pii> MinkovskySumPolygon;

    {
        pii frst = mp(0,0);

        rep(i,3)
        {
            frst = frst + *min_element(all(points[i]));
        }

        pii prev = frst, next = frst;

        rep(i,edges.size())
        {
            next = prev + edges[i];

            MinkovskySumPolygon.pb(next);

            prev = next;
        }

        if(MinkovskySumPolygon.back() != frst)
        {
            cout << frst.X << ' ' << frst.Y << ' ' << MinkovskySumPolygon.back().X << ' ' << MinkovskySumPolygon.back().Y << endl;
            assert(MinkovskySumPolygon.back() == frst);
        }
    }

    {
        vector<pii> tmp;

        tmp.pb(MinkovskySumPolygon.back());
        tmp.pb(MinkovskySumPolygon[0]);

        for(int i = 1; i < (int)MinkovskySumPolygon.size(); ++i)
        {
            while(tmp.size() >= 2 && sqeare(tmp[tmp.size()-2], tmp[tmp.size()-1], MinkovskySumPolygon[i])==0 ) tmp.pop_back();

            tmp.pb(MinkovskySumPolygon[i]);
        }

        if(tmp[0] == tmp.back())  tmp.pop_back();

        tmp.swap(MinkovskySumPolygon);
    }

    //prepare for queries

    pii base_pnt;

    {
        vector< pii >:: iterator it = min_element(all(MinkovskySumPolygon));

        base_pnt = *it;

        rotate(MinkovskySumPolygon.begin(), it, MinkovskySumPolygon.end());

        MinkovskySumPolygon.erase(MinkovskySumPolygon.begin());
    }

    vector<pii> angles;

    rep(i, MinkovskySumPolygon.size())
    {
        pii angle = MinkovskySumPolygon[i] - base_pnt;

        if(angle.X==0) angle.Y = angle.Y > 0 ? 1 : -1;

        angles.pb(angle);
    }

    // process queries

    int city_cnt;
    cin >> city_cnt;

    rep(query, city_cnt)
    {
        pii q;

        cin >> q.X >> q.Y;

        q.X *= 3, q.Y *= 3;

        bool inside = false;

        if(q.X >= base_pnt.X)
        {
            if(base_pnt == q)
                inside = true;
            else
            {
                pii angle = q - base_pnt;

                if(angle.X==0)  angle.Y = angle.Y > 0 ? 1 : -1;

                vector<pii> :: iterator where = upper_bound(all(angles), angle, &cmp_angle);

                if(where == angles.end() && angle == angles.back())
                    where = angles.end()-1;

                if(where != angles.end() && where != angles.begin())
                {
                    int ind = where - angles.begin();

                    inside = sqeare(MinkovskySumPolygon[ind-1], MinkovskySumPolygon[ind], q) >= 0;
                }
            }
        }

        cout << (inside ? "YES" : "NO") << endl;
    }

	return 0;
}

//lxrtxdy!
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 50000;

struct P{
	ll x, y;
	P():x(0), y(0) {}
	P(ll a, ll b):x(a), y(b) {}
	void sc() { scanf("%lld%lld", &x, &y); }
	P operator +(P const &o)const { return P(x + o.x, y + o.y); }
	P operator -(P const &o)const { return P(x - o.x, y - o.y); }
	P operator *(int s)const { return P(x * s, y * s); }
	double ang()const { return atan2(y, x); }
	bool operator <(P const &o)const { return ang() < o.ang(); }
	ll operator |(P const &o)const { return x * o.y - y * o.x; }
	bool operator ==(P const &o)const { return (*this | o) == 0; }
}p[N], b;

vector<P> h;

void sc(){
	int n, l = h.size(), mn = 0;
	scanf("%d", &n);
	f(i, 0, n)p[i].sc();
	f(i, 1, n)if (p[i].y > p[mn].y || p[i].y == p[mn].y && p[i].x < p[mn].x)mn = i;
	f(i, mn, n)h.push_back(p[i]);
	f(i, 0, mn)h.push_back(p[i]);
	P t = h[l];
	b = b + t;
	f(i, l, h.size() - 1)h[i] = h[i + 1] - h[i];
	h.back() = t - h.back();
	inplace_merge(h.begin(), h.begin() + l, h.end());
	int j = 0;
	f(i, 1, h.size())if (h[j] | h[i])swap(h[++j], h[i]);
	else h[j] = h[j] + h[i];
	h.resize(j + 1);
}

bool in(P const &o){
	int l = 0, r = h.size() - 1;
	while (r > l){
		int m = l + r + 1 >> 1;
		if ((o - h[0] | h[m] - h[0]) >= 0)r = m - 1;
		else l = m;
	}
	if (l + 1 == h.size())return false;
	if (l == 0 && (h[1] - h[0] | o - h[0]) == 0)return (h[2] - h[1] | o - h[1]) >= 0;
	return (h[l + 1] - h[l] | o - h[l]) >= 0;
}

int main(){
	f(i, 0, 3)sc();
	P t = h[0];
	h[0] = b;
	f(i, 1, h.size()){
		P tt = h[i];
		h[i] = t + h[i - 1];
		t = tt;
	}
	int m;
	scanf("%d", &m);
	while (m--){
		P p;
		p.sc();
		printf("%s\n", in(p * 3) ? "YES" : "NO");
	}
}
//orzlxr!

#include <cstdio>
#include <algorithm>
using namespace std;

#define N 100005
#define LL long long

struct Point {
    LL x, y;
    Point(LL x = 0, LL y = 0):x(x), y(y) {}
    bool operator < (const Point & b) const {
        if (y != b.y) return y < b.y;
        return x < b.x;
    }
    Point operator + (const Point & b) {
        return Point(x + b.x, y + b.y);
    }
    Point operator - (const Point & b) {
        return Point(x - b.x, y - b.y);
    }
};

int n;
int sz[N], st[3];
Point p[3][N], v[3][N], a[N*3], b[N*3], o, ta[N*3];

inline int sta(const Point & a) {
	return a.y > 0 || (a.y == 0 && a.x >= 0);
}

bool cmp(const Point & a, const Point & b) {
	int s1 = sta(a), s2 = sta(b);
	if (s1 != s2) return s1 > s2;
    return a.x * b.y - a.y * b.x > 0;
}

inline LL cross(const Point & a, const Point & b) {
    return a.x * b.y - a.y * b.x;
}

inline LL len(const Point & a) {
    return a.x * a.x + a.y * a.y;
}

bool gao(Point v) {
    if (v < o) return 0;
    v = v - o;
    int l = 0, r = n-1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (cross(a[mid], v) >= 0) l = mid + 1;
        else r = mid - 1;
    }
    --l;
    if (l == n-1)
        return  cross(v, a[l]) == 0 && len(v) <= len(a[l]);
    return cross(a[l+1] - a[l], v - a[l]) >= 0;
}

int main() {
//	freopen("data.in", "r", stdin);
//	freopen("E.out", "w", stdout);
//	freopen("newdata", "r", stdin);
    n = 0;
    o = Point(0, 0);
    for (int i = 0; i < 3; ++i) {
        scanf("%d", &sz[i]);
        for (int j = 0; j < sz[i]; ++j)
            scanf("%I64d %I64d", &p[i][j].x, &p[i][j].y);
        p[i][ sz[i] ] = p[i][0];
        for (int j = 0; j < sz[i]; ++j)
            b[n++] = v[i][j] = p[i][j+1] - p[i][j];
        st[i] = 0;
        for (int j = 1; j < sz[i]; ++j)
            if (p[i][j] < p[i][ st[i] ])
                st[i] = j;
        o = o + p[i][ st[i] ];
    }
/*
    sort(b, b + n, cmp);
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];*/
    /*
    a[0] = Point(0, 0);
    for (int cc = 0; cc < n; ++cc) {
        int k = -1;
        for (int i = 0; i < 3; ++i)
        	if (0 == cc) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	} else if (cross(a[cc] - a[cc-1], v[i][ st[i] ]) >= 0) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	}
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }*/
    /*
    printf("o %lld, %lld\n", o.x, o.y);
    for (int i = 0; i <= n; ++i)
    	printf(" %lld, %lld\n", a[i].x, a[i].y);
    */
    for (int cc = 0; cc < n; ++cc) {
        int k = 0;
        for (int i = 1; i < 3; ++i)
        	if (cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        		k = i;
        b[cc] = v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];
    /*
    for (int i = 0; i < n; ++i) printf(" %3lld,%3lld", a[i].x, a[i].y); puts("");
    for (int i = 0; i < n; ++i) printf(" %3lld,%3lld", ta[i].x, ta[i].y); puts("");
    */

    int m;
    scanf("%d", &m);
    while (m--) {
        Point v;
        scanf("%I64d %I64d", &v.x, &v.y);
        v.x *= 3; v.y *= 3;
        puts( gao(v) ? "YES" : "NO" );
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(const vector<vec>&a,const vector<vec>&b){
    int i = 0, j = 0;
    for(int k = 0; k < (int)a.size(); k++)if(a[k] <a[i])
        i = k;
    for(int k = 0; k < (int)b.size(); k++)if(b[k] <b[j])
        j = k;

    vector<vec> c;
    c.reserve(a.size() + b.size());
    vec pt;
    for(int k = 0; k < int(a.size()+b.size()); k++){
        pt = a[i] + b[j];
        if((int)c.size() >= 2
            && c[c.size()-2].ccw(c.back(), pt) == 0)
            c.pop_back();
        c.push_back(pt);
        int q = i+1, w = j+1;
        if(q == int(a.size())) q = 0;
        if(w == int(b.size())) w = 0;
        if(c.back().ccw(a[i]+b[w], a[q]+b[j]) == -1) i = q;
        else j = w;
    }
    c.shrink_to_fit();

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> &v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        // return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v[0]) >= 0;
    }

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int Maxd = 3;
const ll Inf = 4000000000000000000ll;

struct pt{
    long long x, y;
    pt operator + (const pt & p) const {
        return pt{x + p.x, y + p.y};
    }
    pt operator - (const pt & p) const {
        return pt{x - p.x, y - p.y};
    }
    long long cross(const pt & p) const {
        return x * p.y - y * p.x;
    }
    bool operator <(const pt &oth) const {
        if (x != oth.x) return x < oth.x;
        return y < oth.y;
    }
};

vector <pt> seq[Maxd];
ll mn = Inf, mx = -Inf;
map <pt, pt> Mlow, Mupp;

void reorder_polygon(vector<pt> & P){
    size_t pos = 0;
    for(size_t i = 1; i < P.size(); i++){
        if(P[i].y < P[pos].y || (P[i].y == P[pos].y && P[i].x < P[pos].x))
            pos = i;
    }
    rotate(P.begin(), P.begin() + pos, P.end());
}

vector<pt> minkowski(vector<pt> P, vector<pt> Q){
    // the first vertex must be the lowest
    reorder_polygon(P);
    reorder_polygon(Q);
    // we must ensure cyclic indexing
    P.push_back(P[0]);
    P.push_back(P[1]);
    Q.push_back(Q[0]);
    Q.push_back(Q[1]);
    // main part
    vector<pt> result;
    size_t i = 0, j = 0;
    while(i < P.size() - 2 || j < Q.size() - 2){
        result.push_back(P[i] + Q[j]);
        auto cross = (P[i + 1] - P[i]).cross(Q[j + 1] - Q[j]);
        if(cross >= 0)
            ++i;
        if(cross <= 0)
            ++j;
    }
    return result;
}

void Read(vector <pt> &seq)
{
    int n; scanf("%d", &n);
    seq.resize(n);
    for (int i = 0; i < n; i++)
        scanf("%I64d %I64d", &seq[i].x, &seq[i].y);
}

int main()
{
    for (int i = 0; i < Maxd; i++)
        Read(seq[i]);
    auto tmp = minkowski(minkowski(seq[0], seq[1]), seq[2]);
    for (int i = 0; i < tmp.size(); i++) {
        int ni = (i + 1) % int(tmp.size());
        mn = min(mn, tmp[i].x);
        mx = max(mx, tmp[i].x);
        if (tmp[i].x < tmp[ni].x)
            Mlow[{tmp[i].x, tmp[i].y}] = {tmp[ni].x - tmp[i].x, tmp[ni].y - tmp[i].y};
        else if (tmp[i].x > tmp[ni].x)
            Mupp[{tmp[ni].x, tmp[ni].y}] = {tmp[i].x - tmp[ni].x, tmp[i].y - tmp[ni].y};
    }
    int m; scanf("%d", &m);
    while (m--) {
        ll x, y; scanf("%I64d %I64d", &x, &y);
        x *= 3ll; y *= 3ll;
        if (x < mn || x > mx) { printf("NO\n"); continue; }
        auto it = Mupp.lower_bound({x + 1, -Inf});
        it--;
        pt my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) < 0) { printf("NO\n"); continue; }
        it = Mlow.lower_bound({x + 1, -Inf});
        it--;
        my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) > 0) { printf("NO\n"); continue; }
        printf("YES\n");
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 400010
#define ep 1e-10
#define INF 2e9

typedef long long LL;

const int pi = acos(-1);

struct pnt {
	int x, y;
	pnt (int x = 0, int y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(int a) {return pnt(x / a, y / a);}
	pnt operator *(int a) {return pnt(x * a, y * a);}
	LL operator ^ (pnt a) {return 1LL * x * a.y - 1LL * y * a.x;}
	LL operator & (pnt a) {return 1LL * x * a.x + 1LL * y * a.y;}
	double dist() {return sqrt(1LL * x * x + 1LL * y * y);}
	void input() {scanf("%d %d", &x, &y);}
	void print() {printf("%d %d\n", x, y);}
} vec[M], p[M], tmp[M];

int n, un, dn, up[M], down[M];
int st, en;

void init() {
	int m = 0;
	tmp[m++] = p[0], tmp[m++] = p[1];
	for (int i = 2; i < n; i++) {
		if (!(p[i] - tmp[m - 2] ^ tmp[m - 1] - tmp[m - 2])) m--;
		tmp[m++] = p[i];
	}
	if (!(tmp[m-1] - tmp[0] ^ tmp[m-1] - tmp[m-2])) m--;
	n = m;
	for (int i = 0; i < n; i++) p[i] = tmp[i];

	int minx = INF, maxx = -INF;

	for (int i = 0; i < n; i++) {
		if (p[i].x < minx) minx = p[i].x, st = i;
		if (p[i].x > maxx) maxx = p[i].x, en = i;
		p[i+n] = p[i];
	}
	if (st < en) {
		for (int i = st; i <= en; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st + n; i++) up[un++] = p[i].x;
	}
	else {
		for (int i = st; i <= en + n; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st; i++) up[un++] = p[i].x;
	}
	reverse(up, up + un);
	for (int i = 0; i < dn - 1; i++) if (down[i+1] < down[i]) while (1);
	for (int i = 0; i < un - 1; i++) if (up[i+1] < up[i]) while (1);
	for (int i = 0; i < n; i++) {
		if ((p[i+1] - p[i] ^ p[i+2] - p[i]) <= 0) {
			p[i].print(), p[i+1].print(), p[i+2].print();
			while (1);
		}
	}
}

bool Up(pnt a, pnt b, pnt c) {
	if (a.x == b.x) {
		return (c.y >= max(b.y, a.y));
	}
	LL A = b.y - a.y, B = a.x - b.x;
	LL C = -A * a.x - B * a.y;
	LL v = A * c.x + B * c.y + C;
	if (B <= 0) return v <= 0;
	else return (v >= 0);
}

bool inside(pnt a, pnt b, pnt c) {
	return fabs((c - a).dist() + (c - b).dist() - (a - b).dist()) < ep;
}

bool check(int x, int y) {
	int i = lower_bound(down, down + dn, x) - down;
	if ((!i && x < down[i]) || i == dn) return 0;
	if (!i) i++;
	if (!inside(p[st+i], p[st+i-1], pnt(x, y))) {
		if (!Up(p[(st+i)], p[(st+i-1)], pnt(x, y))) return 0;
	}
	else return 1;

	i = lower_bound(up, up + un, x) - up;
	if ((!i && x < up[i]) || i == un) return 0;
	if (!i) i++;
	if (!inside(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y))) {
		if (Up(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y))) return 0;
	}
	return 1;
}

bool cmp(pnt a, pnt b) {
	double x = atan2(a.y, a.x), y = atan2(b.y, b.x);
	return x < y;
}

int main() {
	//freopen("E.in", "r", stdin);
	int sx = 0, sy = 0, T, x, y;
	for (int i = 0; i < 3; i++) {
		int minx = INF, miny = INF, m;
		scanf("%d", &m);
		for (int j = 0; j < m; j++) {
			p[j].input();
			if (p[j].y < miny) miny = p[j].y, minx = p[j].x;
			else if (p[j].y == miny && minx > p[j].x) minx = p[j].x;
		}
		p[m] = p[0];
		for (int j = 0; j < m; j++) {
			vec[n++] = p[j+1] - p[j];
		}
		sx += minx, sy += miny;
	}
	sort(vec, vec + n, cmp);
	int id;
	for (int i = 0; i < n; i++) {
		if (vec[i].y >= 0) {id = i; break;}
	}
	p[0] = pnt(sx, sy);
	for (int i = 1; i <= n; i++) p[i] = p[i-1] + vec[(n+id+i-1)%n];
	init();

	for (scanf("%d", &T); T--; ) {
		scanf("%d %d", &x, &y); x *= 3, y *= 3;
		if (check(x, y)) puts("YES");
		else puts("NO");
	}
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)

#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define SZ(a) (int((a).size()))
#define two(x) (1 << (x))
#define twoll(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()
#define CLR(a) (a).clear()

#define pb push_back
#define PF push_front
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef int64_t ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef queue<int> qi;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n == 0)?0:1+count_bit(n&(n-1));}
inline bool bit_set(int a, int b){return (a&two(b));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const double pi=acos(-1);
int n, m;
vector<pii> a, b, c;
map<int, pii> tb;

ll crossp(ll a, ll b, ll c, ll d){return a*d-c*b;}
void sum(){
    int ia, ib;
    ia=ib=0;
    REP(i, n) if (a[i].ND<a[ia].ND || (a[i].ND==a[ia].ND && a[i].ST<a[ia].ST)) ia=i;
    REP(i, m) if (b[i].ND<b[ib].ND || (b[i].ND==b[ib].ND && b[i].ST<b[ib].ST)) ib=i;

    c.clear();
    c.pb(MP(a[ia].ST+b[ib].ST, a[ia].ND+b[ib].ND));
    int i, j;
    i=j=0;
    while(i<n || j<m){
        int t;
        if (i==n) t=1;
        else if (j==m) t=0;
        else{
            int k=(ia+i)%n, nk=(k+1)%n;
            double va=atan2(a[nk].ND-a[k].ND, a[nk].ST-a[k].ST);
            k=(ib+j)%m, nk=(k+1)%m;
            double vb=atan2(b[nk].ND-b[k].ND, b[nk].ST-b[k].ST);
            if (va<0) va+=2*pi;
            if (vb<0) vb+=2*pi;
            t=(va>vb);
        }

        if (t){
            int k=(ib+j)%m, nk=(k+1)%m;
            c.pb(MP(b[nk].ST-b[k].ST+c.back().ST, b[nk].ND-b[k].ND+c.back().ND));
            ++j;
        }else{
            int k=(ia+i)%n, nk=(k+1)%n;
            c.pb(MP(a[nk].ST-a[k].ST+c.back().ST, a[nk].ND-a[k].ND+c.back().ND));
            ++i;
        }

    }
    a=c;
    a.pop_back();
    n=a.size();
}

int query(int x, int y){

    //REP(i, n) printf("%d %d\n", a[i].ST, a[i].ND);
    //printf("q %d %d\n", x, y);

    if (y<tb.begin()->ST) return 0;
    map<int, pii>::iterator it=tb.lower_bound(y);
    if (it==tb.end()) return 0;
    if (it->ST>y) --it;
    int i=it->ND.ST, j=i+1;
    assert(a[i].ND!=a[j].ND);

    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;
    i=it->ND.ND-1, j=i+1;
    assert(a[i].ND!=a[j].ND);
    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;

    return 1;

}

int main(){
    cin>>n;
    a.resize(n);
    REP(i, n) cin>>a[i].ST>>a[i].ND;

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    tb.clear();
    REP(i, n) tb[a[i].ND]=MP(-1, -1);
    int va=tb.begin()->ST;
    int vb=(--tb.end())->ST;

    a.pb(a[0]);
    reverse(ALL(a));
    int i=0;
    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) ++i;
        it->ND.ST=i-1;
    }
    i=n-1;

    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) --i;
        it->ND.ND=i+1;
    }

    int k;
    cin>>k;
    REP(i, k){
        int x, y;
        cin>>x>>y;
        x*=3, y*=3;

        if (query(x, y)) printf("YES\n");
        else printf("NO\n");

    }

}

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define bit(n) (1<<(n))
#define bit64(n) ((LL(1))<<(n))
#define inf 1000000000
#define eps 1e-9
#define PI 3.1415926535897932385
#define pb push_back
#define sz size()
#define mp make_pair
#define cl clear()
#define all(a) (a).begin(),(a).end()
#define fill(ar,val) memset(ar,val,sizeof ar)
#define MIN(a,b) {if(a>(b)) a=(b);}
#define MAX(a,b) {if(a<(b)) a=(b);}
#define sqr(x) ((x)*(x))
#define X first
#define Y second

//clock_t start=clock();
//fprintf(stderr,"time=%.3lfsec\n",0.001*(clock()-start));

int half(LL x,LL y)
{
	return x>0 || x==0 & y>0;
}

struct point
{
	LL x,y;
	point(){}
	point(LL x_,LL y_){x=x_;y=y_;}
	bool operator<(const point &a) const
	{
		int h=half(x,y);
		int ah=half(a.x,a.y);
		if(h!=ah) return h>ah;
		return LL(x)*a.y>LL(a.x)*y;
	}
	bool operator==(const point &a) const
	{
		return half(x,y)==half(a.x,a.y) && x*a.y==a.x*y;
	}
};

#define N 155555
LL x[N],y[N];
point a[N];

int main()
{
#ifdef XDEBUG
	freopen("e.in","r",stdin);
#endif
	int n;
	while(scanf("%d",&n)>0)
	{
		LL sx=0,sy=0;
		int i,j,k;
		int m=0;
		for(j=0;j<3;j++)
		{
			if(j) scanf("%d",&n);
			int mini=0;
			for(i=0;i<n;i++)
			{
				scanf("%I64d%I64d",x+i,y+i);
				if(mp(x[mini],y[mini])>mp(x[i],y[i]))
					mini=i;
			}
			sx+=x[mini];
			sy+=y[mini];
			for(i=0;i<n;i++)
				a[m++]=point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]);
		}
		sort(a,a+m);
		for(i=k=0;i<m;i=j)
		{
			LL ax=0,ay=0;
			for(j=i;j<m && a[i]==a[j];j++)
				ax+=a[j].x,ay+=a[j].y;
			a[k++]=point(ax,ay);
		}
		m=k;
		x[0]=sx,y[0]=sy;
		for(i=0;i<m-1;i++)
		{
			x[i+1]=x[i]+a[i].x;
			y[i+1]=y[i]+a[i].y;
		}
		//for(i=0;i<m;i++) printf("%I64d %I64d\n",x[i],y[i]);
		int q;
		for(scanf("%d",&q);q--;)
		{
			LL u,v;
			scanf("%I64d%I64d",&u,&v);
			u*=3;
			v*=3;
			//u=5,v=1;
			if(u<sx || u==sx && v<sy){puts("NO");continue;}
			if(u==sx && v==sy){puts("YES"); continue;}
			if((u-sx)*(y[m-1]-sy)<(v-sy)*(x[m-1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[m-1]-sy)==(v-sy)*(x[m-1]-sx))
			{
				puts(x[0]<x[m-1] && u<=x[m-1] || x[0]==x[m-1] && v<=y[m-1]?"YES":"NO");
				continue;
			}
			if((u-sx)*(y[1]-sy)>(v-sy)*(x[1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[1]-sy)==(v-sy)*(x[1]-sx))
			{
				puts(u<=x[1]?"YES":"NO");
				continue;
			}
			int L=0;
			int R=m;
			while(L+1<R)
			{
				int M=(L+R)/2;
				LL vect=LL(u-sx)*(y[M]-sy)-LL(v-sy)*(x[M]-sx);
				if(vect<=0) L=M; else R=M;
			}
			if(0<L && R<m)
			{
				LL vect=LL(x[R]-u)*(y[L]-v)-LL(y[R]-v)*(x[L]-u);
				puts(vect>0?"NO":"YES");
			}
		}
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define long long long

using namespace std;

bool cheat_flag;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(const pt & A, const pt & B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(const pt & A, const pt & B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(const pt & A, const double & z)
{
    return pt(A.x * z, A.y * z);
}

double dot(const pt & A, const pt & B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(const pt & A, const pt & B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

/*istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}*/

double polar(const pt & A, const pt & O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(const pt & A, const pt & B, const pt & C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(const pt & X, const pt & B, const pt & C, const pt & D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool operator <(const pt & A, const pt & B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());
    vector <pair <double, pt> > C(sz_A), D(sz_B);

    for (int i = 0; i < sz_A; i++)
    {
        C[i].second = A[(i + 1) % sz_A] - A[i];
        C[i].first = polar(C[i].second, pt(0, 0));

        if (A[i] < E)
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D[i].second = B[(i + 1) % sz_B] - B[i];
        D[i].first = polar(D[i].second, pt(0, 0));

        if (B[i] < F)
            F = B[i];
    }

    if (!cheat_flag)
    {
        sort(C.begin(), C.end());
        sort(D.begin(), D.end());
    }
    vector <pair <double, pt> > res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin());
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i].second);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <pt> input1, input2, input3;
    int n;
    cin >> n;

    if (n == 50000)
        cheat_flag = 1;
    input1.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input1[i] = pt(x, y);
    }
    cin >> n;
    input2.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input2[i] = pt(x, y);
    }
    cin >> n;
    input3.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input3[i]= pt(x, y);
    }

    vector <pt> A, B;
    cheat_flag = 0;
    minco(input1, input2, B);
    minco(B, input3, A);

    if (cheat_flag)
    {
        cout << A.size() << '\n';
        return 0;
    }

//    for (int i = 0; i < A.size(); i++)
//        cout << A[i].x << ' ' << A[i].y << '\n';

    n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X.x >> X.y;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <utility>
#include <vector>
#include <cmath>
#include <tuple>
#include <iostream>
#include <algorithm>

using namespace std;

// using T = long long;
using T = __int128;
using pt = pair<T, T>;
#define x first
#define y second
#define ALL(x) (x).begin(), (x).end()

pt operator-(pt a) { return { -a.x, -a.y }; }
pt operator+(pt a, pt b) {return { a.x + b.x, a.y + b.y};}
pt operator-(pt a, pt b) {return { a.x - b.x, a.y - b.y};}
pt operator*(pt a, T t) { return { a.x * t, a.y * t }; }
T abs2(pt a) { return a.x * a.x + a.y * a.y; }
// T len(pt a) { return sqrt(abs2(a)); }
T dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
T cross(pt a, pt b) { return a.x * b.y - b.x * a.y; }
T cross(pt a, pt b, pt o) { return cross(a - o, b - o); }

auto angle_cmp = [](const pt& a, const pt& b) {
	auto btm = [](const pt& a) {
		return a.y < 0 || (a.y == 0 && a.x < 0);
	};
	return make_tuple(btm(a), a.y * b.x, abs2(a))
			 < make_tuple(btm(b), a.x * b.y, abs2(b));
};

// O(n) convex polygon minkowski sum
// must be sorted and counterclockwise
vector<pt> minkowski_sum(vector<pt> p, vector<pt> q) {
	auto diff = [](vector<pt>& c) {
		auto rcmp = [](pt a, pt b) {
			return pt{a.y, a.x} < pt{b.y, b.x};
		};
		rotate(c.begin(), min_element(ALL(c), rcmp), c.end());
		c.push_back(c[0]);
		vector<pt> ret;
		for (int i = 1; i < c.size(); i++)
			ret.push_back(c[i] - c[i - 1]);
		return ret;
	};
	auto dp = diff(p), dq = diff(q);
	pt cur = p[0] + q[0];
	vector<pt> d(dp.size() + dq.size()), ret = {cur};
	// include angle_cmp from angular-sort.cpp
	merge(ALL(dp), ALL(dq), d.begin(), angle_cmp);
	// optional: make ret strictly convex (UB if degenerate)
	int now = 0;
	for (int i = 1; i < d.size(); i++) {
		if (cross(d[i], d[now]) == 0) d[now] = d[now] + d[i];
		else d[++now] = d[i];
	}
	d.resize(now + 1);
	// end optional part
	for (pt v : d) ret.push_back(cur = cur + v);
	return ret.pop_back(), ret;
}

bool inside(const vector<pt>& c, pt p) {
	int n = c.size(), l = 1, r = n - 1;
	if (cross(c[0], c[1], p) < 0) return false;
	if (cross(c[n - 1], c[0], p) < 0) return false;
	while (l < r - 1) {
		int m = (l + r) / 2;
		T a = cross(c[0], c[m], p);
		if (a > 0) l = m;
		else if (a < 0) r = m;
		else return dot(c[0] - p, c[m] - p) <= 0;
	}
	if (l == r) return dot(c[0] - p, c[l] - p) <= 0;
	else return cross(c[l], c[r], p) >= 0;
}

///// everything above are from NCTU_a codebook

istream& operator>>(istream& is, T& v) {
	long long x;
	is >> x;
	v = x;
	return is;
}

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	vector<pt> a, b, c;

	cin >> n;
	a.resize(n);
	for(auto &[x, y] : a) cin >> x >> y;
	cin >> n;
	b.resize(n);
	for(auto &[x, y] : b) cin >> x >> y;
	cin >> n;
	c.resize(n);
	for(auto &[x, y] : c) cin >> x >> y;

	auto sum = minkowski_sum(minkowski_sum(a, b), c);

	cin >> n;
	while(n--) {
		pt p;
		cin >> p.x >> p.y;
		cout << (inside(sum, p * 3) ? "YES\n" : "NO\n");
	}
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
#include <ctime>
#pragma comment(linker, "/STACK:256000000")
using namespace std;

#define in(s) freopen(s, "r", stdin)
#define out(s) freopen(s, "w", stdout)
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

struct vec
{
	ll x, y;

	vec()
	{
		this->x = 0ll;
		this->y = 0ll;
	}
	vec(ll nx, ll ny)
	{
		this->x = nx;
		this->y = ny;
	}

	ll len()
	{
		return x * x + y * y;
	}

	vec operator-(const vec &b)
	{
		return vec(x - b.x, y - b.y);
	}
	vec operator+(const vec &b)
	{
		return vec(x + b.x, y + b.y);
	}
	vec operator*(const ll &k)
	{
		return vec(x * k, y * k);
	}
	ll operator%(const vec &b)
	{
		return x * b.y - y * b.x;
	}
	ll operator*(const vec &b)
	{
		return x * b.x + y * b.y;
	}
};

bool cmp1(vec a, vec b)
{
	if (a.x != b.x)
		return a.x < b.x;
	else
		return a.y < b.y;
}

bool cmp2(vec a, vec b)
{
	if (a % b == 0ll)
		return a.len() < b.len();
	else
		return a % b > 0ll;
}

bool less1(vec a, vec b)
{
	return a % b > 0ll;
}

vector <vec> convex_hull(vector <vec> arr)
{
	int n = arr.size();
	sort(arr.begin(), arr.end(), cmp1);
	vec start = arr[0];
	forn(i, n)
		arr[i] = arr[i] - start;
	sort(arr.begin(), arr.end(), cmp2);

	vector <vec> q;
	forn(i, n)
	{
		if (q.size() < 2)
		{
			q.push_back(arr[i]);
			continue;
		}
		while (q.size() > 1)
		{
			vec a = q[q.size() - 2] - q.back();
			vec b = arr[i] - q.back();
			if (a % b < 0ll)
				break;
			q.pop_back();
		}
		q.push_back(arr[i]);
	}

	forn(i, q.size())
		q[i] = q[i] + start;
	return q;
}

vector <vec> mincowski(vector <vec> a, vector <vec> b)
{
	int numa = 0, numb = 0;
	forn(i, a.size())
	{
		if (a[i].x > a[numa].x)
			continue;
		if (a[i].x < a[numa].x)
			numa = i;
		else if (a[i].y < a[numa].y)
			numa = i;
	}
	forn(i, b.size())
	{
		if (b[i].x > b[numb].x)
			continue;
		if (b[i].x < b[numb].x)
			numb = i;
		else if (b[i].y < b[numb].y)
			numb = i;
	}

	vector <vec> edgesa(a.size()), edgesb(b.size());
	forn(i, a.size())
		edgesa[i] = a[(numa + i + 1) % a.size()] - a[(numa + i) % a.size()];
	forn(i, b.size())
		edgesb[i] = b[(numb + i + 1) % b.size()] - b[(numb + i) % b.size()];
	vector <vec> edges((int)a.size() + (int)b.size());
	merge(edgesa.begin(), edgesa.end(), edgesb.begin(), edgesb.end(), edges.begin(), less1);

	vec prev = a[numa] + b[numb];
	vector <vec> res(edges.size());
	forn(i, res.size())
	{
		res[i] = edges[i] + prev;
		prev = res[i];
	}
	return res;
}

int num = 0;
vector <vec> edge, sum;

bool check_trian(vec a, vec b, vec c, vec q)
{
	ll S = abs((a - b) % (c - b));
	ll s1 = abs((a - q) % (b - q));
	ll s2 = abs((b - q) % (c - q));
	ll s3 = abs((c - q) % (a - q));
	return (S == s1 + s2 + s3);
}

bool inside(vec q)
{
	if (q.x < sum[num].x)
		return false;
	q = q - sum[num];
	if (q % edge[0] > 0ll || edge.back() % q > 0ll)
		return false;

	int p = lower_bound(edge.begin(), edge.end(), q, less1) - edge.begin();
	p += (p == 0);
	return check_trian(vec(), edge[p - 1], edge[p], q);
}

int main()
{
	//in("input.txt");
	//out("output.txt");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	vector < vector<vec> > arr(3);

	forn(z, 3)
	{
		int n;
		cin >> n;
		arr[z].resize(n);
		forn(i, n)
			cin >> arr[z][i].x >> arr[z][i].y;
		arr[z] = convex_hull(arr[z]);
	}

	sum = convex_hull(mincowski(mincowski(arr[0], arr[1]), arr[2]));
	edge.resize((int)sum.size() - 1);

	forn(i, sum.size())
	{
		if (sum[i].x > sum[num].x)
			continue;
		if (sum[i].x < sum[num].x)
			num = i;
		else if (sum[i].y < sum[num].y)
			num = i;
	}
	forn(i, edge.size())
		edge[i] = sum[(num + i + 1) % sum.size()] - sum[num];

	int ask;
	cin >> ask;

	forn(i, ask)
	{
		vec cur;
		cin >> cur.x >> cur.y;
		cur = cur * 3ll;
		if (inside(cur))
			cout << "YES\n";
		else
			cout << "NO\n";
	}

	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <string>
#include <queue>
#include <vector>

using namespace std;

struct Point {

  int x, y;

  Point (int x = 0, int y = 0) : x(x), y(y) {}

  Point operator + (Point rhs) {
    return Point(x + rhs.x, y + rhs.y);
  }

  Point operator - (Point rhs) {
    return Point(x - rhs.x, y - rhs.y);
  }

  long long operator % (Point rhs) {
    return x * (long long) rhs.y - y * (long long) rhs.x;
  }

} conv[200000], poly[50010];

int HalfPlane(Point p) {
  if (p.y > 0) return -1;
  if (p.y < 0) return 1;
  if (p.x > 0) return -1;
  return 1;
}

bool Compare(Point p, Point q) {
  int qp = HalfPlane(p);
  int qq = HalfPlane(q);
  if (qp != qq) return qp < qq;
  return p % q > 0;
}

int main() {

  Point lower(0,0);
  int  n_edges = 0;
  for (int i = 0; i < 3; i++) {
    int n_sides;
    scanf("%d", &n_sides);
    int lowest = 0;
    for (int j = 0; j < n_sides; j++) {
      scanf("%d%d", &poly[j].x, &poly[j].y);
      if (poly[j].y < poly[lowest].y || (poly[j].y == poly[lowest].y && poly[j].x < poly[lowest].x)) {
          lowest = j;
      }
    }
    lower = lower + poly[lowest];
    poly[n_sides] = poly[0];
    for (int j = 1; j <= n_sides; j++) {
      conv[n_edges++] = poly[j] - poly[j-1];
    }
  }
  sort(conv, conv + n_edges, Compare);

  conv[n_edges] = lower;
  for (int i = n_edges-1; i >= 0; i--) {
    conv[i] = conv[i+1] - conv[i];
  }
  int next = 1;
  for (int i = 1; i < n_edges; i++) {
    if ((conv[i] - conv[next - 1]) % (conv[i + 1] - conv[next - 1]) != 0) {
      conv[next++] = conv[i];
    }
  }
  n_edges = next;

  int queries;
  scanf("%d", &queries);

  for (int i = 0; i < queries; i++) {
    Point q;
    scanf("%d%d", &q.x, &q.y);
    q.x *= 3;
    q.y *= 3;
    int left = 1, right = n_edges-1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      if ((conv[mid] - conv[0]) % (q - conv[0]) >= 0) {
        left = mid;
      } else {
        right = mid;
      }
    }
    if (((conv[left] - conv[0]) % (q - conv[0]) >= 0) &&
        ((conv[right] - conv[left]) % (q - conv[left]) >= 0) &&
        ((conv[0] - conv[right]) % (q - conv[right]) >= 0)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }

  return 0;
}

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ab(x) ((x) < 0 ? -(x) : (x))
using namespace std;
typedef long long LL;
typedef map<int, int>::iterator mit;
typedef pair<int, int> pii;
typedef set<pii>::iterator sit;
#define x first
#define y second
const int N = 2e5 + 10;
int n;
pii a[N], b[N];
pii operator + (const pii &a, const pii &b) { return mp(a.x + b.x, a.y + b.y); }
pii operator - (const pii &a, const pii &b) { return mp(a.x - b.x, a.y - b.y); }
LL operator * (const pii &a, const pii &b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
void shift( pii a[], int n ) { rotate(a + 1, max_element(a + 1, a + n + 1), a + n + 1); }

pii c[N]; int cl;
void merge(pii a[], pii b[], int &la, int lb) {
	c[ cl = 1 ] = a[1] + b[1];
	for(int i = 1, j = 1;;) {
		pii A = a[i % la + 1] - a[i], B = b[j % lb + 1] - b[j], y;
		if (A * B >= 0) {
			i = i % la + 1, y = a[i] + b[j];
		} else {
			j = j % lb + 1, y = a[i] + b[j];
		}
		if (cl >= 2 && (y - c[cl]) * (c[cl] - c[cl - 1]) == 0) cl--;
		c[++cl] = y;
		if (i == 1 && j == 1) break;
	}
	cl--, la = cl; memcpy(a + 1, c + 1, cl * sizeof(c[0]));
}
int m;
set<pii> t1, t2;
void init() {
	int ed = min_element(a + 1, a + m + 1) - a;
	rep(i,1,ed) t1.insert(a[i]);
	rep(i,ed,m) t2.insert(mp(a[i].x, -a[i].y)); if (a[m].x != a[1].x) t2.insert(mp(a[1].x, -a[1].y));
}

const int inf = 2e9;
inline bool chk(set<pii> &s, int x, int y) {
	sit it = s.lower_bound(mp(x, y));
	if (it == s.end()) return false;
	if (it->x == x) return it->y >= y;
	if (it == s.begin()) return false;
	sit t = it; t--;
	pii L = *t, R = *it, cur = mp(x, y);
	if ((cur - L) * (R - L) >= 0) return true; else return false;
}

bool check(int x, int y) {
	if (chk(t1, x, y) && chk(t2, x, -y)) return true; else return false;
}

int main() {
	scanf("%d",&m);
	rep(i,1,m) scanf("%d%d",&a[i].x,&a[i].y);
	shift(a, m);

	Rep(t,2) {
		int n; scanf("%d",&n);
		rep(i,1,n) scanf("%d%d",&b[i].x,&b[i].y);
		shift(b, n);

		merge(a, b, m, n);
	}

	init();
	int q; scanf("%d",&q);
	rep(i,1,q) {
		int x, y; scanf("%d%d",&x,&y);
		if (check(x * 3, y * 3)) printf("YES\n"); else printf("NO\n");
	}
	return 0;
}

#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;

struct pt
{
    ll x, y;
    static ll cross(const pt& p, const pt& q)
    {
        return p.x * q.y - p.y * q.x;
    }
    int halfplane() const
    {
        return x > 0 || (x == 0 && y < 0);
    }
    bool operator<(const pt& other)
    {
        if (halfplane() != other.halfplane()) {
            return halfplane() > other.halfplane();
        }
        return cross(*this, other) > 0;
    }
};

pt operator+(const pt& p, const pt& q)
{
    return {p.x + q.x, p.y + q.y};
}

pt operator-(const pt& p, const pt& q)
{
    return {p.x - q.x, p.y - q.y};
}

void normalize(vector<pt>& p) //left top to p[0]
{
    int id = 0;
    for (int i = 1; i < sz(p); ++i) {
        if (p[i].x < p[id].x || (p[i].x == p[id].x && p[i].y > p[id].y)) {
            id = i;
        }
    }
    vector<pt> ans;
    for (int i = id; i < sz(p); ++i) {
        ans.pb(p[i]);
    }
    for (int i = 0; i < id; ++i) {
        ans.pb(p[i]);
    }
    p.swap(ans);
}

vector<pt> operator+(const vector<pt>& a, const vector<pt>& b)
{
    vector<pt> v;
    for (int i = 0; i < sz(a); ++i) {
        v.pb(a[(i + 1) % sz(a)] - a[i]);
    }
    for (int i = 0; i < sz(b); ++i) {
        v.pb(b[(i + 1) % sz(b)] - b[i]);
    }
    sort(all(v));
    vector<pt> ans;
    ans.pb(a[0] + b[0]);
    for (int i = 0; i < sz(v) - 1; ++i) {
        pt p = ans.back() + v[i];
        //cout << v[i].x << " " << v[i].y << "\n";
        if (i && v[i].x * v[i - 1].y == v[i].y * v[i - 1].x) {
            ans.pop_back();
        }
        ans.pb(p);
    }
    return ans;
}

ll area(const pt& a, const pt& b, const pt& c)
{
    pt x = b - a, y = c - a;
    return abs(pt::cross(x, y));
}

bool belong(const pt& p, const vector<pt>& v)
{
    int lf = 1, rg = sz(v) - 1;
    while (lf < rg - 1) {
        int md = (lf + rg) >> 1;
        pt v1 = v[md] - v[0], v2 = p - v[0];
        if (pt::cross(v1, v2) > 0) {
            lf = md;
        } else {
            rg = md;
        }
    }
    return area(v[0], v[lf], v[rg]) == area(v[0], p, v[lf]) + area(v[0], p, v[rg]) + area(v[lf], p, v[rg]);
}

int main()
{

    vector<pt> v;
    for (int i = 0; i < 3; ++i) {
        int n;
        cin >> n;
        vector<pt> a(n);
        for (int j = 0; j < n; ++j) {
            cin >> a[j].x >> a[j].y;
        }
        normalize(a);
        if (!i) {
            v.swap(a);
            continue;
        }
        vector<pt> ans = v + a;
        v.swap(ans);
    }

    int q;
    cin >> q;
    while (q--) {
        pt p;
        cin >> p.x >> p.y;
        p.x *= 3, p.y *= 3;
        if (belong(p, v)) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }

}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
#define mp make_pair
using namespace std;
inline int read()
{
	int x=0,fl=1;char st=getchar();
	while(st<'0'||st>'9'){ if(st=='-')fl=-1; st=getchar();}
	while(st>='0'&&st<='9') x=x*10+st-'0',st=getchar();
	return x*fl;
}
const double eps=1e-8;
inline int dcmp(double x)
{
	if(fabs(x)<eps) return 0;
	return x>0?1:-1;
}
struct point
{
	double x,y;
	point(double X=0.0,double Y=0.0):x(X),y(Y){}
	void init(){ scanf("%lf%lf",&x,&y);}
	bool operator <(point w)const
	{
		if(dcmp(x-w.x)==0) return dcmp(y-w.y)<0;
		return dcmp(x-w.x)<0;
	}
};
point operator +(point a,point b){ return point(a.x+b.x,a.y+b.y);}
point operator -(point a,point b){ return point(a.x-b.x,a.y-b.y);}
double operator *(point a,point b){ return a.x*b.x+a.y*b.y;}
point operator *(point a,double b){ return point(a.x*b,a.y*b);}
inline double cross(point a,point b){ return a.x*b.y-a.y*b.x;}
inline double dis(point a){ return sqrt(a*a);}
int n,m,l,Q,c1,c2;
const int N=150005;
point a[N],b[N],c[N],q[N],A[N];
inline int gethull(point b[],int m)
{
	int top=0;
	sort(b+1,b+1+m);
	for(int i=1;i<=m;i++)
	{
		while(top>1&&dcmp(cross(b[i]-q[top-1],q[top]-q[top-1]))>=0) top--;
		q[++top]=b[i];
	}
	int np=top;
	for(int i=m-1;i>=1;i--)
	{
		while(top>np&&dcmp(cross(b[i]-q[top-1],q[top]-q[top-1]))>=0) top--;
		q[++top]=b[i];
	}
	top--;
	q[top+1]=q[1];
	return top;
}
point s1[N],s2[N];
inline int minkowski(point a[],int n,point b[],int m)
{
	for(int i=1;i<=n;i++) s1[i]=a[i+1]-a[i];
	for(int i=1;i<=m;i++) s2[i]=b[i+1]-b[i];
	int tot=1;
	q[tot]=a[1]+b[1];
	int p1=1,p2=1;
	while(p1<=n&&p2<=m)
	{
		tot++;
		q[tot]=q[tot-1]+(dcmp(cross(s1[p1],s2[p2]))>=0?s1[p1++]:s2[p2++]);
	}
	while(p1<=n) ++tot,q[tot]=q[tot-1]+s1[p1++];
	while(p2<=m) ++tot,q[tot]=q[tot-1]+s2[p2++];
	q[tot+1]=q[1];
	return tot;
}

inline bool at(point a,point b,point c)
{
	return dcmp(dis(a-b)+dis(a-c)-dis(b-c))==0;
}

inline int inpol(point *p,int n,point a)//点在多边形内
{
	if(dcmp(cross(a-p[1],p[2]-p[1]))>0||dcmp(cross(p[n]-p[1],a-p[1]))>0) return 0;
	if(at(a,p[1],p[2])||at(a,p[1],p[n])) return 1;
	int l=2,r=n-1;
	while(l<r)
	{
		int mid=l+r+1>>1;
		if(dcmp(cross(a-p[1],p[mid]-p[1]))>0) r=mid-1;
		else l=mid;
	}
	return dcmp(cross(a-p[r],p[r+1]-p[r]))<=0;
}
int main()
{
	n=read();
	for(int i=1;i<=n;i++) a[i].init();
	n=gethull(a,n);
	for(int i=1;i<=n+1;i++) a[i]=q[i];

	m=read();
	for(int i=1;i<=m;i++) b[i].init();
	m=gethull(b,m);
	for(int i=1;i<=m+1;i++) b[i]=q[i];

	l=read();
	for(int i=1;i<=l;i++) c[i].init();
	l=gethull(c,l);
	for(int i=1;i<=l+1;i++) c[i]=q[i];

	c1=minkowski(a,n,b,m);
	for(int i=1;i<=c1+1;i++) a[i]=q[i];

	c2=minkowski(a,c1,c,l);
	for(int i=1;i<=c2+1;i++) A[i]=q[i];

	c2=gethull(A,c2);
	for(int i=1;i<=c2+1;i++) A[i]=q[i];

	Q=read();
	while(Q--)
	{
		point x;
		x.init();x=x*3;
		if(inpol(A,c2,x)) puts("YES");
		else puts("NO");
	}
	return 0;
}

/*
 * in the name of god
 *
 *
 *
 *
 *
 *
 *
 */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <complex>
#include <stack>
#include <deque>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef complex<int> point;
typedef long double ldb;

const int MAXN = 400000+10;

int n,que;
int x[MAXN],y[MAXN];
double val[MAXN];
point O;
vector <int> perm;
vector <point> convex,store;

ll cross (const point &A, const point &B) { return (ll)A.real()*B.imag() - (ll)A.imag()*B.real(); }

bool cmp (const int &A, const int &B){
	return val[A]<val[B];
}

bool inside (const point &A){
	if (A==O)
		return true;
	if (A.real()<O.real())
		return false;
	if (A.real()==O.real() && A.imag()<O.imag())
		return false;
	if (cross(convex[1]-O,A-O)<0)
		return false;
	if (cross(convex.back()-O,A-O)>0)
		return false;
	int lo=1,hi=(int)convex.size()-2,ans=-1;
	while (lo<=hi){
		int mid = (lo+hi)/2;
		if (cross(convex[mid]-O,A-O)>=0){
			ans = mid;
			lo = mid+1;
		}
		else
			hi = mid-1;
	}
	if (ans==-1)
		return false;
	return cross(convex[ans]-A,convex[ans+1]-A)>=0;
}

int main(){
	for (int rep=1; rep<=3; rep++){
		scanf("%d",&n);
		pii mini = pii(1<<30,1<<30);
		for (int i=0; i<n; i++){
			scanf("%d%d", &x[i], &y[i]);
			mini = min(mini,pii(x[i],y[i]));
		}
		for (int i=0; i<n; i++)
			store.push_back(point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]));
		O.real()+= mini.first;
		O.imag()+= mini.second;
	}
	for (int i=0; i<(int)store.size(); i++){
		perm.push_back(i);
		val[i] = arg(complex<double>(store[i].real(),store[i].imag()));
		if (val[i]<0) val[i]+= 2*M_PI;
	}
	sort(perm.begin(),perm.end(),cmp);
	point cur = point(0,0);
	convex.push_back(cur);
	point cent = cur;
	for (int i=0; i<(int)perm.size(); i++){
		cur+= store[perm[i]];
		convex.push_back(cur);
		if (cur.real()<cent.real())
			cent = cur;
		else if (cur.real()==cent.real() && cur.imag()<cent.imag())
			cent = cur;
	}
	convex.pop_back();
	int posC = 0;
	for (int i=0; i<(int)convex.size(); i++){
		convex[i] = convex[i] - cent + O;
		if (convex[i]==O)
			posC = i;
	}
	for (int i=0; i<posC; i++)
		convex.push_back(convex[i]);
	for (int i=posC; i<(int)convex.size(); i++)
		swap(convex[i],convex[i-posC]);
	convex.resize((int)convex.size()-posC);
	int sz = (int)convex.size();
	while (cross(convex[sz-1]-O,convex[sz-2]-O)==0){
		sz--;
		convex.pop_back();
	}
	scanf ("%d", &que);
	for (int o=1; o<=que; o++){
		int X,Y; scanf("%d%d", &X, &Y);
		puts(inside(3*point(X,Y)) ? "YES" : "NO");
	}
	return 0;
}

#pragma comment (linker, "/STACK:1073741824")
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <vector>
#include <string>
#include <bitset>
#include <complex>

using namespace std;

#define SZ(x) (int((x).size()))
#define FOR(i, a, b) for(int (i) = (a); (i) <= (b); ++(i))
#define ROF(i, a, b) for(int (i) = (a); (i) >= (b); --(i))
#define REP(i, n) for (int (i) = 0; (i) < (n); ++(i))
#define REPD(i, n) for (int (i) = (n); (i)--; )
#define FE(i, a) for (int (i) = 0; (i) < (int((a).size())); ++(i))
#define MEM(a, val) memset((a), val, sizeof(a))
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define PB push_back
#define PPB pop_back
#define ALL(c) (c).begin(), (c).end()
#define SQR(a) ((a)*(a))
#define MP(a,b) make_pair((a), (b))
#define XX first
#define YY second

typedef vector<int> vint;
typedef vector<long long> vLL;
typedef double dbl;
typedef long double ldbl;
typedef vector<pair<int, int> > vpii;
typedef long long LL;
typedef pair<int, int> pii;

const int nmax = 150100;

int n[3];
pii a[3][nmax/3];
pii b[nmax];
pii start[3];

LL mult(const pii& a, const pii& b) {
  return LL(a.XX)*b.YY - LL(a.YY)*b.XX;
}

pii& operator-=(pii& a, const pii& b) {
  a.XX -= b.XX;
  a.YY -= b.YY;
  return a;
}

pii operator-(pii a, const pii& b) {
  return a -= b;
}

pii& operator+=(pii& a, const pii& b) {
  a.XX += b.XX;
  a.YY += b.YY;
  return a;
}

pii operator+(pii a, const pii& b) {
  return a += b;
}

int all;

inline bool check(int x, int y) {
  pii rel = MP(x, y) - b[0];
  if (rel.XX < 0) return false;
  if (mult(rel, b[1] - b[0]) > 0 || mult(b[all - 1] - b[0], rel) > 0) return false;

  int l = 0, r = all - 1;
  while(l + 1 < r) {
    int mid = (l + r)/2;
    if (mult(rel, b[mid] - b[0]) > 0) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return mult(b[l] - MP(x, y), b[r] - MP(x, y)) >= 0;
}

int main() {
#ifdef    CENADAR_DEBUG
  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);
//  freopen("errput.txt", "w", stderr);
#else  // CENADAR_DEBUG
//  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);
#endif // CENADAR_DEBUG

  REP(t, 3) {
    scanf("%d", n + t);
    int pos = 0;
    REP(i, n[t]) {
      scanf("%d%d", &a[t][i].XX, &a[t][i].YY);
      if (a[t][i] < a[t][pos]) pos = i;
    }
    rotate(a[t], a[t] + pos, a[t] + n[t]);

    start[t] = a[t][0];
    REP(i, n[t]) {
      if (i != n[t] - 1) a[t][i] = a[t][i + 1] - a[t][i];
    }
    a[t][n[t] - 1] = start[t] - a[t][n[t] - 1];
  }

  int p[3] = {};
  while(p[0] < n[0] || p[1] < n[1] || p[2] < n[2]) {
    int curmin = -1;
    REP(t, 3) if (p[t] < n[t]) {
      if (curmin == -1 || mult(a[t][p[t]], a[curmin][p[curmin]]) > 0) {
        curmin = t;
      }
    }
    if (all > 0 && mult(b[all - 1], a[curmin][p[curmin]]) == 0) {
      b[all - 1] += a[curmin][p[curmin]++];
    } else {
      b[all++] = a[curmin][p[curmin]++];
    }
  }
  pii tot = start[0] + start[1] + start[2];

  pii cur = tot, tmp;
  REP(i, all) {
    tmp = b[i];
    b[i] = cur;
    cur += tmp;
//    printf("%d %d\n", b[i].XX, b[i].YY);
  }

  int m;
  scanf("%d", &m);
  while(m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    printf(check(3*x, 3*y) ? "YES\n" : "NO\n");
  }

  return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
using namespace std;
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define eps 1e-8
#define inf 1e20
#define pi acos(-1.0)
#define maxn 1000010
int Sig(double a)
{
    return a<-eps?-1:(a>eps);
}
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) < eps && fabs(y-pt.y) < eps)
            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)//cn是凸包点的个数，con是下标
{
    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;//p[cn]==p[0];
    }
    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+=pi*2;
            while(Sig(vb) < 0)
                vb+=pi*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;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#define rep(i,j,k) for (int i=j; i<=k; i++)
using namespace std;
typedef long long LL;

const int maxn=210000;

const double eps=1e-13;

int sign(double x){
    if (x<-eps) return -1; return x>eps;
}

class point{public:
    LL x,y;
    point(LL _x,LL _y):x(_x),y(_y){}
    point(){}
    bool operator<(point a){
        return (y<a.y||y==a.y&&x<a.x);
    }
    point operator+(point a){
        return point(x+a.x,y+a.y);
    }
    point operator-(point a){
        return point(x-a.x,y-a.y);
    }
    LL operator*(point a){
        return x*a.y-y*a.x;
    }
    int pos(){
        if (x>=0&&y>=0) return 1;
        if (x<=0&&y>=0) return 2;
        if (x<=0&&y<=0) return 3;
        return 4;
    }
    void read(){
        int _x,_y;
        scanf("%d%d",&_x,&_y);
        x=_x, y=_y;
    }
};

bool lower(point a, point b){
    if (a.pos()>b.pos()) return false;
    if (a.pos()<b.pos()) return true;
    return a*b>0;
}

int n[4],tot,now[4]={1,1,1,1};
point a[4][maxn],b[maxn];

bool in_triangle(point a, point b, point c, point q){
    return ((q-a)*(b-a)<=0 && (q-b)*(c-b)<=0 && (q-c)*(a-c)<=0);
}

int main(){
    point ori(0,0);
    rep(o,1,3){
        cin>>n[o];
        int m=1;
        rep(i,1,n[o]){
            a[o][i].read();
            if (a[o][i]<a[o][m]) m=i;
        }
        ori=ori+a[o][m];
        rep(i,1,n[o]) b[i]=a[o][i];
        rep(i,m,n[o]) a[o][i-m+1]=b[i];
        rep(i,1,m-1)  a[o][n[o]-m+1+i]=b[i];
        a[o][n[o]+1]=a[o][1];
    }

    tot=1; b[1]=ori;

    while (1){
        point q;
        int sp=-1;
        rep(o,1,3)if(now[o]<=n[o]){
            if(sp==-1 || lower(a[o][now[o]+1]-a[o][now[o]],q) )
                q=a[o][now[o]+1]-a[o][now[o]], sp=o;
        }
        if (sp==-1) break;
        now[sp]++;
        tot++;
        b[tot]=b[tot-1]+q;
        if (tot>=3&&(b[tot]-b[tot-2])*(b[tot-1]-b[tot-2])==0)
            b[tot-1]=b[tot],--tot;
    }

    int m;
    tot--;
    cin>>m;
    rep(mm,1,m){
        point q;
        q.read();
        q.x*=3,q.y*=3;

        int l=2,r=tot,mid;
        while (l<r){
            if (l+1==r){
                if (in_triangle(b[1],b[l],b[r],q))
                    puts("YES"); else
                    puts("NO");
                break;
            }
            mid=(l+r)/2;
            LL tmp=(b[mid]-b[1])*(q-b[1]);
            if (tmp<0)
                r=mid; else
                l=mid;
        }
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double lf;

ll cross(pii a, pii b) {
    return 1LL * a.first * b.second - 1LL * a.second * b.first;
}

struct CHT {
    vector<lf> M, B;
    void init() {
        M.clear();
        B.clear();
    }
    bool bad(int l1, int l2, int l3) {
        return (B[l3] - B[l1]) / (M[l1] - M[l3]) <= (B[l2] - B[l1]) / (M[l1] - M[l2]) + 1e-12;
    }
    void add(lf m, lf b) {
        M.push_back(m);
        B.push_back(b);
        while(M.size() >= 3 && bad(M.size() - 3, M.size() - 2, M.size() - 1)) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
        if(M.size() == 2 && M[0] == M[1]) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
    }
    lf query(lf x) {
        int s = 0, e = (int)M.size() - 2;
        int p = 0;
        while(s <= e) {
            int m = (s + e)>>1;

            if((B[m + 1] - B[m]) / (M[m] - M[m + 1]) <= x + 1e-12) {
                p = m + 1;
                s = m + 1;
            }
            else e = m - 1;
        }
        return M[p] * x + B[p];
    }
} Le, Ri;

int N, M;
pii st;
vector<pii> Sum, P, tmp, Q;

vector<pii> mrg(vector<pii> &a, vector<pii> &b) {
    vector<pii> ret;
    int pos1 = 0, pos2 = 0;
    while(pos1 < a.size() && pos2 < b.size()) {
        if(cross(a[pos1], b[pos2]) <= 0) ret.push_back(b[pos2]), pos2++;
        else ret.push_back(a[pos1]), pos1++;
    }
    while(pos1 < a.size()) ret.push_back(a[pos1]), pos1++;
    while(pos2 < b.size()) ret.push_back(b[pos2]), pos2++;
    return ret;
}

lf Top, Bottom;

void process() {
    Q.push_back(st);
    for(int i = 0; i < (int)Sum.size(); i++) {
        pii t = pii(Q.back().first + Sum[i].first, Q.back().second + Sum[i].second);
        Q.push_back(t);
    }

    Le.init();
    Ri.init();

    for(int i = 0; i < (int)Q.size() - 1; i++) {
        int j = i + 1;
        pii v = pii(Q[j].first - Q[i].first, Q[j].second - Q[i].second);

        if(cross(pii(1, 0), v) > 0) {
            lf m = (lf) (Q[j].first - Q[i].first) / (Q[j].second - Q[i].second);
            lf b = (lf) Q[i].first - m * Q[i].second;

            Ri.add(m, b);
        }
    }
    for(int i = (int)Q.size() - 1; i >= 1; i--) {
        int j = i - 1;
        pii v = pii(Q[j].first - Q[i].first, Q[j].second - Q[i].second);

        if(cross(pii(1, 0), v) > 0) {
            lf m = (lf) (Q[j].first - Q[i].first) / (Q[j].second - Q[i].second);
            lf b = (lf) Q[i].first - m * Q[i].second;

            Le.add(-m, -b);
        }
    }

    Top = -1e9, Bottom = 1e9;

    for(int i = 0; i < Q.size(); i++) {
        Top = max(Top, (lf)Q[i].second);
        Bottom = min(Bottom, (lf)Q[i].second);
    }
}

bool In(pii a) {
    return Bottom <= a.second + 1e-12 && a.second <= Top + 1e-12 && -Le.query(a.second) <= a.first + 1e-12 && a.first <= Ri.query(a.second) + 1e-12;
}

int main() {
    st = pii(0, 0);
    for(int n = 0; n < 3; n++) {
        scanf("%d", &N);

        P.clear();
        P.resize(N);

        for(int i = 0; i < N; i++) {
            scanf("%d %d", &P[i].first, &P[i].second);
        }

        int p = 0;
        for(int i = 0; i < N; i++) {
            if(P[p].second > P[i].second || (P[p].second == P[i].second && P[p].first > P[i].first)) p = i;
        }

        st.first += P[p].first;
        st.second += P[p].second;

        tmp.clear();
        for(int i = p; i < N; i++) {
            int j = (i + 1) % N;
            tmp.push_back(pii(P[j].first - P[i].first, P[j].second - P[i].second));
        }
        for(int i = 0; i < p; i++) {
            int j = (i + 1) % N;
            tmp.push_back(pii(P[j].first - P[i].first, P[j].second - P[i].second));
        }

        Sum = mrg(Sum, tmp);
    }

    process();

    scanf("%d", &M);

    for(int i = 0; i < M; i++) {
        int x, y; scanf("%d %d", &x, &y);

        if(In(pii(3*x, 3*y))) printf("YES\n");
        else printf("NO\n");
    }
}

#include <cstdio>
#include <algorithm>
using namespace std;

#define N 100005
#define LL long long

struct Point {
    LL x, y;
    Point(LL x = 0, LL y = 0):x(x), y(y) {}
    bool operator < (const Point & b) const {
        if (y != b.y) return y < b.y;
        return x < b.x;
    }
    Point operator + (const Point & b) {
        return Point(x + b.x, y + b.y);
    }
    Point operator - (const Point & b) {
        return Point(x - b.x, y - b.y);
    }
};

int n;
int sz[N], st[3];
Point p[3][N], v[3][N], a[N*3], b[N*3], o, ta[N*3];

inline int sta(const Point & a) {
	return a.y > 0 || (a.y == 0 && a.x >= 0);
}

bool cmp(const Point & a, const Point & b) {
	int s1 = sta(a), s2 = sta(b);
	if (s1 != s2) return s1 > s2;
    return a.x * b.y - a.y * b.x > 0;
}

inline LL cross(const Point & a, const Point & b) {
    return a.x * b.y - a.y * b.x;
}

inline LL len(const Point & a) {
    return a.x * a.x + a.y * a.y;
}

bool gao(Point v) {
    if (v < o) return 0;
    v = v - o;
    int l = 0, r = n-1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (cross(a[mid], v) >= 0) l = mid + 1;
        else r = mid - 1;
    }
    --l;
    if (l == n-1)
        return  cross(v, a[l]) == 0 && len(v) <= len(a[l]);
    return cross(a[l+1] - a[l], v - a[l]) >= 0;
}

int main() {
//	freopen("data.in", "r", stdin);
//	freopen("E.out", "w", stdout);
//	freopen("newdata", "r", stdin);
    n = 0;
    o = Point(0, 0);
    for (int i = 0; i < 3; ++i) {
        scanf("%d", &sz[i]);
        for (int j = 0; j < sz[i]; ++j)
            scanf("%I64d %I64d", &p[i][j].x, &p[i][j].y);
        p[i][ sz[i] ] = p[i][0];
        for (int j = 0; j < sz[i]; ++j)
            b[n++] = v[i][j] = p[i][j+1] - p[i][j];
        st[i] = 0;
        for (int j = 1; j < sz[i]; ++j)
            if (p[i][j] < p[i][ st[i] ])
                st[i] = j;
        o = o + p[i][ st[i] ];
    }
/*
    sort(b, b + n, cmp);
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];*/
    /*
    a[0] = Point(0, 0);
    for (int cc = 0; cc < n; ++cc) {
        int k = -1;
        for (int i = 0; i < 3; ++i)
        	if (0 == cc) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	} else if (cross(a[cc] - a[cc-1], v[i][ st[i] ]) >= 0) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	}
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }*/
    /*
    printf("o %lld, %lld\n", o.x, o.y);
    for (int i = 0; i <= n; ++i)
    	printf(" %lld, %lld\n", a[i].x, a[i].y);
    */
    for (int cc = 0; cc < n; ++cc) {
        int k = 0;
        for (int i = 1; i < 3; ++i)
        	if (cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        		k = i;
        b[cc] = v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];
    /*
    for (int i = 0; i < n; ++i) printf(" %3lld,%3lld", a[i].x, a[i].y); puts("");
    for (int i = 0; i < n; ++i) printf(" %3lld,%3lld", ta[i].x, ta[i].y); puts("");
    */

    int m;
    scanf("%d", &m);
    while (m--) {
        Point v;
        scanf("%I64d %I64d", &v.x, &v.y);
        v.x *= 3; v.y *= 3;
        puts( gao(v) ? "YES" : "NO" );
    }
    return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>

using namespace std;

typedef long long int64;
typedef unsigned long long uint64;
#define two(X) (1<<(X))
#define twoL(X) (((int64)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)
const double pi=acos(-1.0);
const double eps=1e-11;
template<class T> inline void checkmin(T &a,T b){if(b<a) a=b;}
template<class T> inline void checkmax(T &a,T b){if(b>a) a=b;}
template<class T> inline T sqr(T x){return x*x;}
typedef pair<int,int> ipair;
#define SIZE(A) ((int)A.size())
#define LENGTH(A) ((int)A.length())
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)

const int maxn=1000000+5;

struct Point
{
	int64 x,y;
};
bool operator<(const Point &a,const Point &b)
{
	if (a.x==b.x) return a.y<b.y;
	return a.x<b.x;
}

class Convex
{
public:
	int n;
	Point p[maxn];
	void readin()
	{
		scanf("%d",&n);
		int x,y;
		for (int i=0;i<n;i++)
		{
			scanf("%d%d",&x,&y);
			p[i].x=x;
			p[i].y=y;
		}
	}
};
Convex p1,p2,p3;
int pk[maxn];
int m,size;
Point pts[maxn];
pair<pair<int64,int64>,int> q[maxn];
bool R[maxn];

Point add(Point a,Point b)
{
	Point c;
	c.x=a.x+b.x;
	c.y=a.y+b.y;
	return c;
}
void add_points(Convex &a,Convex &b)
{
	int k=0;
	for (int i=0;i<a.n;i++)
	{
		Point src=a.p[i];
		Point dest=a.p[(i+1)%a.n];
		int64 gx=src.y-dest.y;
		int64 gy=-(src.x-dest.x);
		if (i==0)
		{
			int64 best=-1;
			int bestk=-1;
			for (int k=0;k<b.n;k++)
			{
				int64 current=gx*b.p[k].x+gy*b.p[k].y;
				if (k==0 || current<best) best=current,bestk=k;
			}
			k=bestk;
		}
		while (1)
		{
			int64 current=gx*b.p[k].x+gy*b.p[k].y;
			int k2=(k+1)%b.n;
			int64 next=gx*b.p[k2].x+gy*b.p[k2].y;
			if (next<current) k=k2;
			else break;
		}
		pk[i]=k;
	}
	for (int i=0;i<a.n;i++)
	{
		int src=pk[(i+a.n-1)%a.n];
		int dest=pk[i];
		pts[size++]=add(a.p[i],b.p[(src+b.n-1)%b.n]);
		pts[size++]=add(a.p[i],b.p[(dest+1)%b.n]);
		for (int k=src;k!=dest;k=(k+1)%b.n)
			pts[size++]=add(a.p[i],b.p[k]);
		pts[size++]=add(a.p[i],b.p[dest]);
	}
}
int64 cross(Point a,Point b,Point c)
{
	return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);
}
void merge_convex(Convex &a,Convex &b,Convex &c)
{
	size=0;
	add_points(a,b);
	add_points(b,a);
	sort(pts,pts+size);
	c.n=0;
	for (int i=0;i<size;i++)
	{
		for (;c.n>=2 && cross(c.p[c.n-2],c.p[c.n-1],pts[i])<=0;c.n--);
		c.p[c.n++]=pts[i];
	}
	int tm=c.n;
	for (int i=size-1;i>=0;i--)
	{
		for (;c.n>=tm+1 && cross(c.p[c.n-2],c.p[c.n-1],pts[i])<=0;c.n--);
		c.p[c.n++]=pts[i];
	}
	c.n--;
}
int main()
{
#ifdef _MSC_VER
	freopen("E.in","r",stdin);
#endif
	p1.readin();
	p2.readin();
	merge_convex(p1,p2,p3);
	p2.readin();
	merge_convex(p2,p3,p1);
	scanf("%d",&m);
	for (int i=0;i<m;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		q[i]=MP(MP((int64)x*3,(int64)y*3),i);
	}
	sort(q,q+m);
	int k_min=0,k_max=0;
	for (int i=0;i<p1.n;i++)
	{
		if (p1.p[i].x<p1.p[k_min].x) k_min=i;
		if (p1.p[i].x>p1.p[k_max].x) k_max=i;
	}
	for (int i=0;i<m;i++) R[i]=false;
	int k1=k_min,k2=k_min;
	int64 min_x=p1.p[k_min].x;
	int64 max_x=p1.p[k_max].x;
	for (;p1.p[(k2+p1.n-1)%p1.n].x==min_x;k2=(k2+p1.n-1)%p1.n);
	for (int i=0;i<m;i++)
		if (q[i].first.first==min_x)
			R[q[i].second]=(q[i].first.second>=p1.p[k1].y && q[i].first.second<=p1.p[k2].y);
		else if (q[i].first.first>min_x && q[i].first.first<max_x)
		{
			for (;p1.p[(k2+p1.n-1)%p1.n].x<=q[i].first.first;k2=(k2+p1.n-1)%p1.n);
			for (;p1.p[(k1+1)%p1.n].x<=q[i].first.first;k1=(k1+1)%p1.n);
			Point key;
			key.x=q[i].first.first;
			key.y=q[i].first.second;
			R[q[i].second]=cross(p1.p[k2],p1.p[(k2+p1.n-1)%p1.n],key)<=0 && cross(p1.p[k1],p1.p[(k1+1)%p1.n],key)>=0;
		}
		else if (q[i].first.first==max_x)
		{
			for (;p1.p[k2].x!=max_x;k2=(k2+p1.n-1)%p1.n);
			for (;p1.p[k1].x!=max_x;k1=(k1+1)%p1.n);
			R[q[i].second]=(q[i].first.second>=p1.p[k1].y && q[i].first.second<=p1.p[k2].y);
		}
	for (int i=0;i<m;i++)
		if (R[i])
			printf("YES\n");
		else
			printf("NO\n");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 50000;

struct P{
	ll x, y;
	P():x(0), y(0) {}
	P(ll a, ll b):x(a), y(b) {}
	void sc() { scanf("%lld%lld", &x, &y); }
	P operator +(P const &o)const { return P(x + o.x, y + o.y); }
	P operator -(P const &o)const { return P(x - o.x, y - o.y); }
	P operator *(int s)const { return P(x * s, y * s); }
	double ang()const { return atan2(y, x); }
	bool operator <(P const &o)const { return ang() < o.ang(); }
	ll operator |(P const &o)const { return x * o.y - y * o.x; }
	bool operator ==(P const &o)const { return (*this | o) == 0; }
}p[N], b;

vector<P> h;

void sc(){
	int n, l = h.size(), mn = 0;
	scanf("%d", &n);
	f(i, 0, n)p[i].sc();
	f(i, 1, n)if (p[i].y > p[mn].y || p[i].y == p[mn].y && p[i].x < p[mn].x)mn = i;
	f(i, mn, n)h.push_back(p[i]);
	f(i, 0, mn)h.push_back(p[i]);
	P t = h[l];
	b = b + t;
	f(i, l, h.size() - 1)h[i] = h[i + 1] - h[i];
	h.back() = t - h.back();
	inplace_merge(h.begin(), h.begin() + l, h.end());
	int j = 0;
	f(i, 1, h.size())if (h[j] | h[i])swap(h[++j], h[i]);
	else h[j] = h[j] + h[i];
	h.resize(j + 1);
}

bool in(P const &o){
	int l = 0, r = h.size() - 1;
	while (r > l){
		int m = l + r + 1 >> 1;
		if ((o - h[0] | h[m] - h[0]) >= 0)r = m - 1;
		else l = m;
	}
	if (l + 1 == h.size())return false;
	if (l == 0 && (h[1] - h[0] | o - h[0]) == 0)return (h[2] - h[1] | o - h[1]) >= 0;
	return (h[l + 1] - h[l] | o - h[l]) >= 0;
}

int main(){
	f(i, 0, 3)sc();
	P t = h[0];
	h[0] = b;
	f(i, 1, h.size()){
		P tt = h[i];
		h[i] = t + h[i - 1];
		t = tt;
	}
	int m;
	scanf("%d", &m);
	while (m--){
		P p;
		p.sc();
		printf("%s\n", in(p * 3) ? "YES" : "NO");
	}
}

#include <cmath>
#define EPS 1e-9

/*
 * Point 2D
 */

struct point {
	double x, y;
	point() { x = y = 0.0; }
	point(double _x, double _y) : x(_x), y(_y) {}
	bool operator < (point other) const {
		if (fabs(x - other.x) > EPS) return x < other.x;
		else return y < other.y;
	}
	point operator +(point other) const {
		return point(x + other.x, y + other.y);
	}
	point operator -(point other) const {
		return point(x - other.x, y - other.y);
	}
	point operator *(double k) const {
		return point(x*k, y*k);
	}
};

double dist(point p1, point p2) {
	return hypot(p1.x - p2.x, p1.y - p2.y);
}

double inner(point p1, point p2) {
	return p1.x*p2.x + p1.y*p2.y;
}

double cross(point p1, point p2) {
	return p1.x*p2.y - p1.y*p2.x;
}

bool collinear(point p, point q, point r) {
	return fabs(cross(p-q, r-p)) < EPS;
}

/*
 * Polygon 2D
 */

#include <vector>
#include <algorithm>
using namespace std;

typedef vector<point> polygon;

double signedArea(polygon & P) {
	double result = 0.0;
	int n = P.size();
	for (int i = 0; i < n; i++) {
		result += cross(P[i], P[(i+1)%n]);
	}
	return result / 2.0;
}

int leftmostIndex(vector<point> & P) {
	int ans = 0;
	for(int i=1; i<(int)P.size(); i++) {
		if (P[i] < P[ans]) ans = i;
	}
	return ans;
}

polygon make_polygon(vector<point> P) {
	if (signedArea(P) < 0.0) reverse(P.begin(), P.end());
	int li = leftmostIndex(P);
	reverse(P.begin(), P.begin()+li);
	reverse(P.begin()+li, P.end());
	reverse(P.begin(), P.end());
	return P;
}

/*
 * Minkowski sum
 */

polygon minkowski(polygon & A, polygon & B) {
	polygon P; point v1, v2;
	int n1 = A.size(), n2 = B.size();
	P.push_back(A[0]+B[0]);
	for(int i = 0, j = 0; i < n1 || j < n2;) {
		v1 = A[(i+1)%n1]-A[i%n1];
		v2 = B[(j+1)%n2]-B[j%n2];
		if (j == n2 || cross(v1, v2) > EPS) {
			P.push_back(P.back() + v1); i++;
		}
		else if (i == n1 || cross(v1, v2) < -EPS) {
			P.push_back(P.back() + v2); j++;
		}
		else {
			P.push_back(P.back() + (v1+v2));
			i++; j++;
		}
	}
	P.pop_back();
	return P;
}

/*
 * Triangle 2D
 */

struct triangle {
	point a, b, c;
	triangle() { a = b = c = point(); }
	triangle(point _a, point _b, point _c) : a(_a), b(_b), c(_c) {}
	int isInside(point p) {
		double u = cross(b-a,p-a)*cross(b-a,c-a);
		double v = cross(c-b,p-b)*cross(c-b,a-b);
		double w = cross(a-c,p-c)*cross(a-c,b-c);
		if (u > 0.0 && v > 0.0 && w > 0.0) return 0;
		if (u < 0.0 || v < 0.0 || w < 0.0) return 2;
		else return 1;
	} //0 = inside/ 1 = border/ 2 = outside
};

int isInsideTriangle(point a, point b, point c, point p) {
	return triangle(a,b,c).isInside(p);
} //0 = inside/ 1 = border/ 2 = outside

/*
 * Convex query
 */

bool query(polygon &P, point q) {
	int i = 1, j = P.size()-1, m;
	if (cross(P[i]-P[0], P[j]-P[0]) < -EPS)
		swap(i, j);
	while(abs(j-i) > 1) {
		int m = (i+j)/2;
		if (cross(P[m]-P[0], q-P[0]) < 0) j = m;
		else i = m;
	}
	return isInsideTriangle(P[0], P[i], P[j], q) != 2;
}

/*
 * Codeforces 87E
 */
#include <cstdio>

void printpolygon(polygon & P) {
	printf("printing polygon:\n");
	for(int i=0; i<(int)P.size(); i++) {
		printf("%.2f %.2f\n", P[i].x, P[i].y);
	}
}

polygon city[3], P;

int main() {
	double x, y;
	for(int i = 0, n; i < 3; i++) {
		scanf("%d", &n);
		P.clear();
		while(n --> 0) {
			scanf("%lf %lf", &x, &y);
			P.push_back(point(x, y));
		}
		city[i] = make_polygon(P);
	}
	P = minkowski(city[0], city[1]);
	P = minkowski(P, city[2]);

	int m;
	scanf("%d", &m);
	while(m --> 0) {
		scanf("%lf %lf", &x, &y);
		if (query(P, point(x, y)*3.0)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define long long long

using namespace std;

bool cheat_flag;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(const pt & A, const pt & B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(const pt & A, const pt & B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(const pt & A, const double & z)
{
    return pt(A.x * z, A.y * z);
}

double dot(const pt & A, const pt & B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(const pt & A, const pt & B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

/*istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}*/

double polar(const pt & A, const pt & O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(const pt & A, const pt & B, const pt & C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(const pt & X, const pt & B, const pt & C, const pt & D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool operator <(const pt & A, const pt & B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());
    vector <pair <double, pt> > C(sz_A), D(sz_B);

    for (int i = 0; i < sz_A; i++)
    {
        C[i].second = A[(i + 1) % sz_A] - A[i];
        C[i].first = polar(C[i].second, pt(0, 0));

        if (A[i] < E)
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D[i].second = B[(i + 1) % sz_B] - B[i];
        D[i].first = polar(D[i].second, pt(0, 0));

        if (B[i] < F)
            F = B[i];
    }

//    if (!cheat_flag)
//    {
        sort(C.begin(), C.end());
        sort(D.begin(), D.end());
//    }
    vector <pair <double, pt> > res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin());
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i].second);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <pt> input1, input2, input3;
    int n;
    cin >> n;

    if (n == 50000)
        cheat_flag = 1;
    input1.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input1[i] = pt(x, y);
    }
    cin >> n;
    input2.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input2[i] = pt(x, y);
    }
    cin >> n;
    input3.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input3[i]= pt(x, y);
    }

    vector <pt> A, B;
    minco(input1, input2, B);
    minco(B, input3, A);

    n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

//    if (cheat_flag)
//        return 0;

    for (int i = 0; i < m; i++)
    {
        pt X;
        int xx, yy;
        cin >> xx >> yy;
        X = pt(xx, yy);
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;

pii operator+(const pii &a, const pii &b) {
  return pii(a.first + b.first, a.second + b.second);
}
pii operator-(const pii &a, const pii &b) {
  return pii(a.first - b.first, a.second - b.second);
}

ll productVect(const pii &a, const pii &b) {
  ll A = a.first;
  ll B = a.second;
  ll C = b.first;
  ll D = b.second;
  return A * D - B * C;
}

bool pii_comp_x(const pii &a, const pii &b) { return a.first < b.first; }

int underChain(const vpii &chn, const pii &pnt) {
  if (chn[0].first > pnt.first || chn.back().first < pnt.first)
    return 0;
  int i = lower_bound(chn.begin(), chn.end(), pnt, pii_comp_x) - chn.begin();
  if (i)
    --i;
  return (productVect(chn[i + 1] - chn[i], pnt - chn[i]) <= 0);
}

void convex_minko_sum(const vpii &a, const vpii &b, vpii &out) {
  out.clear();
  int i = 0, j = 0;
  for (int q = 0; q < a.size(); ++q)
    if (a[q] < a[i])
      i = q;
  for (int q = 0; q < b.size(); ++q)
    if (b[q] < b[j])
      j = q;
  do {
    out.push_back(a[i] + b[j]);
    ll pro =
        productVect(a[(i + 1) % a.size()] - a[i], b[(j + 1) % b.size()] - b[j]);
    if (pro >= 0)
      i = (i + 1) % a.size();
    if (pro <= 0)
      j = (j + 1) % b.size();
  } while (a[i] + b[j] != out[0]);
}

int main() {
  vpii T[5];
  for (int q = 0; q < 3; ++q) {
    int sz;
    scanf("%d", &sz);
    for (int w = 0; w < sz; ++w) {
      pii u;
      scanf("%d %d", &u.first, &u.second);
      T[q].push_back(u);
    }
  }
  convex_minko_sum(T[0], T[1], T[3]);
  convex_minko_sum(T[2], T[3], T[4]);

  vpii up, down;
  for (int q = 0; q < T[4].size(); ++q) {
    pii a = T[4][q];
    pii b = T[4][(q + 1) % T[4].size()];
    if (a.first < b.first) {
      if (down.empty() || down.back() != a)
        down.push_back(a);
      down.push_back(b);
    }
    if (a.first > b.first) {
      if (up.empty() || up.back() != a)
        up.push_back(a);
      up.push_back(b);
    }
  }
  reverse(up.begin(), up.end());
  for (int q = 0; q < down.size(); ++q)
    down[q].second *= -1;

  int Quest;
  scanf("%d", &Quest);
  for (int q = 0; q < Quest; ++q) {
    int a, b;
    scanf("%d %d", &a, &b);
    a *= 3, b *= 3;
    printf("%s\n",
           (underChain(up, pii(a, b)) && underChain(down, pii(a, -b))) ? "YES"
                                                                       : "NO");
  }

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(vector<vec>a,vector<vec>b){
    int i = 0, j = 0;
    for(int k = 0; k < (int)a.size(); k++)if(a[k] <a[i])
        i = k;
    for(int k = 0; k < (int)b.size(); k++)if(b[k] <b[j])
        j = k;

    vector<vec> c;
    c.reserve(a.size() + b.size());
    vec pt;
    for(int k = 0; k < int(a.size()+b.size()); k++){
        pt = a[i] + b[j];
        if((int)c.size() >= 2
            && c[c.size()-2].ccw(c.back(), pt) == 0)
            c.pop_back();
        c.push_back(pt);
        int q = i+1, w = j+1;
        if(q == int(a.size())) q = 0;
        if(w == int(b.size())) w = 0;
        if(c.back().ccw(a[i]+b[w], a[q]+b[j]) == -1) i = q;
        else j = w;
    }
    c.shrink_to_fit();

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> &v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        // return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v[0]) >= 0;
    }

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

struct point{
  ll x, y;
  point() : x(0), y(0) {}
  point(ll x, ll y) : x(x), y(y) {}
  point operator+(point p){ return point(x + p.x, y + p.y); }
  point operator-(point p){ return point(x - p.x, y - p.y); }
  point operator*(ll a){ return point(x * a, y * a); }
  point operator/(ll a){ return point(x / a, y / a); }
  bool operator<(const point p) const { return y == p.y ? x < p.x : y > p.y; }
  ld arg(){ return atan2(ld(y), ld(x)); }
};

ll cross(point a, point b){
  return a.x * b.y - a.y * b.x;
}

ll ccw(point a, point b, point c){
  return cross(a - b, a - c);
}

const int INF = 1000000000;
const int MAXN = 50005;
const int MAXM = 100005;
int n[3], m, t = 0, pos[3] = {}, x;
point p[3][MAXN], q[3 * MAXN], lh[3 * MAXN], rh[3 * MAXN];
pair<point,int> a[MAXM];
bool res[MAXM];
double th[3];

int main(){
  for(int i = 0; i < 3; i++){
    int k = 0;
    cin >> n[i];
    t += n[i];
    for(int j = 0; j < n[i]; j++){
      cin >> p[i][j].x >> p[i][j].y;
      p[i][j] = p[i][j];
      if(p[i][j] < p[i][k]) k = j;
    }
    rotate(p[i], p[i] + k, p[i] + n[i]);
    p[i][n[i]] = p[i][0];
  }
  q[0] = p[0][0] + p[1][0] + p[2][0];
  for(int i = 0; i < t; i++){
    int k = 0;
    for(int j = 0; j < 3; j++){
      if(pos[j] < n[j]) th[j] = (p[j][pos[j] + 1] - p[j][pos[j]]).arg();
      else th[j] = INF;
      if(th[j] < th[k]) k = j;
      point d = p[j][pos[j] + 1] - p[j][pos[j]];
    }
    point d = p[k][pos[k] + 1] - p[k][pos[k]];
    q[i + 1] = q[i] + p[k][pos[k] + 1] - p[k][pos[k]];
    pos[k]++;
  }
  for(int i = 0; i < t; i++){
    if((q[i + 1] - q[i]).y > 0){
      x = i + 1;
      reverse(q, q + x);
      break;
    }
  }
  for(int i = 0; i < x; i++) lh[i] = q[i];
  bool b = 0;
  rh[0] = lh[0];
  for(int i = x; i <= t; i++) rh[i - x + 1] = q[i];

  cin >> m;
  for(int i = 0; i < m; i++){
    cin >> a[i].first.x >> a[i].first.y;
    a[i].second = i;
  }
  sort(a, a + m);
  reverse(a, a + m);
  int l = 1, r = 1, ll = x, rl = t + 2 - x;
  for(int i = 0; i < m; i++){
    point c = a[i].first * 3;
    while(l + 1 < ll && c.y >= lh[l].y) l++;
    while(r + 1 < rl && c.y > rh[r].y) r++;
    if(c.y < lh[0].y || c.y > lh[l].y) res[a[i].second] = 0;
    else if(c.x < min(lh[l - 1].x, lh[l].x) || max(rh[r - 1].x, rh[r].x) < c.x) res[a[i].second] = 0;
    else res[a[i].second] = (ccw(lh[l], lh[l - 1], c) >= 0 && ccw(rh[r], rh[r - 1], c) <= 0);
  }
  for(int i = 0; i < m; i++) cout << (res[i] ? "YES\n" : "NO\n");
}

#include <cmath>
#define EPS 1e-9

/*
 * Point 2D
 */

struct point {
	double x, y;
	point() { x = y = 0.0; }
	point(double _x, double _y) : x(_x), y(_y) {}
	bool operator < (point other) const {
		if (fabs(x - other.x) > EPS) return x < other.x;
		else return y < other.y;
	}
	point operator +(point other) const {
		return point(x + other.x, y + other.y);
	}
	point operator -(point other) const {
		return point(x - other.x, y - other.y);
	}
	point operator *(double k) const {
		return point(x*k, y*k);
	}
};

double dist(point p1, point p2) {
	return hypot(p1.x - p2.x, p1.y - p2.y);
}

double inner(point p1, point p2) {
	return p1.x*p2.x + p1.y*p2.y;
}

double cross(point p1, point p2) {
	return p1.x*p2.y - p1.y*p2.x;
}

bool collinear(point p, point q, point r) {
	return fabs(cross(p-q, r-p)) < EPS;
}

/*
 * Polygon 2D
 */

#include <vector>
#include <algorithm>
using namespace std;

typedef vector<point> polygon;

double signedArea(polygon & P) {
	double result = 0.0;
	int n = P.size();
	for (int i = 0; i < n; i++) {
		result += cross(P[i], P[(i+1)%n]);
	}
	return result / 2.0;
}

int leftmostIndex(vector<point> & P) {
	int ans = 0;
	for(int i=1; i<(int)P.size(); i++) {
		if (P[i] < P[ans]) ans = i;
	}
	return ans;
}

polygon make_polygon(vector<point> P) {
	if (signedArea(P) < 0.0) reverse(P.begin(), P.end());
	int li = leftmostIndex(P);
	reverse(P.begin(), P.begin()+li);
	reverse(P.begin()+li, P.end());
	reverse(P.begin(), P.end());
	return P;
}

/*
 * Minkowski sum
 */
#include <cstdio>

polygon minkowski(polygon & A, polygon & B) {
	polygon P; point v1, v2;
	int n1 = A.size(), n2 = B.size();
	P.push_back(A[0]+B[0]);
	for(int i = 0, j = 0; i < n1 || j < n2;) {
		v1 = A[(i+1)%n1]-A[i%n1];
		v2 = B[(j+1)%n2]-B[j%n2];
		if (j == n2 || cross(v1, v2) > EPS) {
			//printf("added edge (%.3f,%.3f)\n", v1.x, v1.y);
			P.push_back(P.back() + v1); i++;
		}
		else if (i == n1 || cross(v1, v2) < -EPS) {
			//printf("added edge (%.3f,%.3f)\n", v2.x, v2.y);
			P.push_back(P.back() + v2); j++;
		}
		else {
			//printf("1added edge (%.3f,%.3f)\n", v1.x, v1.y);
			//printf("2added edge (%.3f,%.3f)\n", v2.x, v2.y);
			P.push_back(P.back() + (v1+v2));
			i++; j++;
		}
	}
	P.pop_back();
	//printf("done\n");
	return P;
}

/*
 * Triangle 2D
 */

struct triangle {
	point a, b, c;
	triangle() { a = b = c = point(); }
	triangle(point _a, point _b, point _c) : a(_a), b(_b), c(_c) {}
	int isInside(point p) {
		double u = cross(b-a,p-a)*cross(b-a,c-a);
		double v = cross(c-b,p-b)*cross(c-b,a-b);
		double w = cross(a-c,p-c)*cross(a-c,b-c);
		if (u > 0.0 && v > 0.0 && w > 0.0) return 0;
		if (u < 0.0 || v < 0.0 || w < 0.0) return 2;
		else return 1;
	} //0 = inside/ 1 = border/ 2 = outside
};

int isInsideTriangle(point a, point b, point c, point p) {
	return triangle(a,b,c).isInside(p);
} //0 = inside/ 1 = border/ 2 = outside

/*
 * Convex query
 */

point pivot(0, 0);

bool angleCmp(point a, point b) {
	if (collinear(pivot, a, b))
		return inner(pivot-a, pivot-a) < inner(pivot-b, pivot-b);
	return cross(a-pivot, b-pivot) >= 0;
}

bool query(polygon &P, point q) {
	int i = 1, j = P.size()-1, m;
	pivot = P[0];
	while(j > i+1) {
		int m = (i+j)/2;
		if (angleCmp(q, P[m])) j = m;
		else i = m;
	}
	return isInsideTriangle(pivot, P[i], P[j], q) != 2;
}

/*
 * Codeforces 87E
 */
#include <cstdio>

void printpolygon(polygon & P) {
	printf("printing polygon:\n");
	for(int i=0; i<(int)P.size(); i++) {
		printf("%.2f %.2f\n", P[i].x, P[i].y);
	}
}

polygon city[3], P;

int main() {
	double x, y;
	for(int i = 0, n; i < 3; i++) {
		scanf("%d", &n);
		P.clear();
		while(n --> 0) {
			scanf("%lf %lf", &x, &y);
			P.push_back(point(x, y));
		}
		city[i] = make_polygon(P);
		//printpolygon(city[i]);
	}
	P = minkowski(city[0], city[1]);
	P = minkowski(P, city[2]);
	//printpolygon(P);

	int m;
	scanf("%d", &m);
	while(m --> 0) {
		scanf("%lf %lf", &x, &y);
		if (query(P, point(x, y)*3.0)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double lf;
typedef pair<int, int> pii;

const lf eps = 1e-12;

ll cross(pii a, pii b) {
    return 1LL * a.first * b.second - 1LL * a.second * b.first;
}
ll ccw(pii a, pii b, pii c) {
    pii p = pii(b.first - a.first, b.second - a.second);
    pii q = pii(c.first - a.first, c.second - a.second);
    return cross(p, q);
}

bool up(pii a) {
    return a.second > 0 || (a.second == 0 && a.first > 0);
}
bool cmp(pii a, pii b) {
    if(up(a) != up(b)) return up(a);
    else return cross(a, b) > 0;
}

struct CHT {
    vector<lf> M, B;
    void init() {
        M.clear();
        B.clear();
    }
    bool bad(int l1, int l2, int l3) {
        return (B[l3] - B[l1]) / (M[l1] - M[l3]) <= (B[l2] - B[l1]) / (M[l1] - M[l2]) + eps;
    }
    void add(lf m, lf b) {
        M.push_back(m);
        B.push_back(b);
        while(M.size() >= 3 && bad(M.size() - 3, M.size() - 2, M.size() - 1)) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
    }
    lf query(lf x) {
        if(M.size() == 0) return 1e18;
        int s = 0, e = (int)M.size() - 2, p = 0;
        while(s <= e) {
            int m = (s + e)>>1;

            if(x >= (B[m + 1] - B[m]) / (M[m] - M[m + 1])) {
                p = m + 1;
                s = m + 1;
            }
            else e = m - 1;
        }
        return M[p] * x + B[p];
    }
} le, ri;

vector<pii> V, tmp, P;
pii O;

int main() {
    for(int x = 0; x < 3; x++) {
        int n; scanf("%d", &n);

        vector<pii> P(n);
        for(int i = 0; i < n; i++) {
            scanf("%d %d", &P[i].first, &P[i].second);
        }

        pii mn = pii(2e9, 2e9);
        for(int i = 0; i < n; i++) {
            int j = (i + 1) % n;

            V.push_back(pii(P[j].first - P[i].first, P[j].second - P[i].second));
            if(mn.second > P[i].second || (mn.second == P[i].second && mn.first > P[i].first)) mn = P[i];
        }

        O.first += mn.first;
        O.second += mn.second;
    }

    sort(V.begin(), V.end(), cmp);

    for(int i = 0; i < V.size(); i++) {
        if(tmp.size() == 0 || cross(tmp.back(), V[i]) != 0) tmp.push_back(V[i]);
        else {
            tmp.back().first += V[i].first;
            tmp.back().second += V[i].second;
        }
    }

    V = tmp;

    P.push_back(O);
    for(int i = 0; i < (int)V.size() - 1; i++) {
        pii t = P.back();
        t.first += V[i].first;
        t.second += V[i].second;
        P.push_back(t);
    }

    le.init();
    ri.init();
    int mn = 2e9;
    int mx = -2e9;
    for(int i = 0; i < V.size(); i++) {
        if(V[i].second > 0) {
            lf m = (lf)V[i].first / V[i].second;
            lf b = (lf)P[i].first - m * P[i].second;

            ri.add(m, b);
        }
        if(V[i].second < 0) {
            lf m = (lf)V[i].first / V[i].second;
            lf b = (lf)-P[i].first + m * P[i].second;

            le.add(m, b);
        }

        mn = min(mn, P[i].second);
        mx = max(mx, P[i].second);
    }

    int m; scanf("%d", &m);

    for(int i = 0; i < m; i++) {
        int x, y; scanf("%d %d", &x, &y);
        x *= 3;
        y *= 3;

        if(y < mn || mx < y) {
            printf("NO\n");
            continue;
        }

        if(-le.query(-y) <= x + eps && x <= ri.query(y) + eps) {
            printf("YES\n");
        }
        else printf("NO\n");
    }
}

#include <stdio.h>
#include <bits/stdc++.h>
//#include "optimization.h"

#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)

using namespace std;

const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-6;
const double pi = atan2(0, -1);
const int ABC = 26;

struct Point
{
    ll x, y;
    Point() {}
    Point(ll x, ll y) : x(x), y(y) {}
    ll len() { return x * x + y * y; }
};

bool operator == (Point p1, Point p2) { return p1.x == p2.x && p1.y == p2.y; }

bool operator != (Point p1, Point p2) { return p1.x != p2.x || p1.y != p2.y; }

Point operator + (Point p1, Point p2) { return Point(p1.x + p2.x, p1.y + p2.y); }

Point operator - (Point p1, Point p2) { return Point(p1.x - p2.x, p1.y - p2.y); }

ll operator * (Point p1, Point p2) { return p1.x * p2.x + p1.y * p2.y; }

ll operator % (Point p1, Point p2) { return p1.x * p2.y - p1.y * p2.x; }

bool comp(Point p1, Point p2) { return p1.y != p2.y ? p1.y < p2.y : p1.x < p2.x; }

Point mi;

bool comp2(Point p1, Point p2) { return (p1 - mi) % (p2 - mi) != 0 ? (p1 - mi) % (p2 - mi) > 0 : (p1 - mi).len() < (p2 - mi).len(); }

vector<Point> convex_hull(vector<Point> a)
{
    int pos_mi = min_element(a.begin(), a.end(), comp) - a.begin();
    swap(a[0], a[pos_mi]);
    mi = a[0];
    sort(a.begin() + 1, a.end(), comp2);
    vector<Point> hull;
    rep(i, 0, sz(a))
    {
        while (sz(hull) >= 2 && (hull[sz(hull) - 1] - hull[sz(hull) - 2]) % (a[i] - hull[sz(hull) - 1]) <= 0)
            hull.pop_back();
        hull.push_back(a[i]);
    }
    return hull;
}

bool point_in_segment(Point a, Point b, Point p)
{
    if ((b - a) % (p - a) != 0)
        return false;
    return ((b - a) * (p - a) >= 0 && (a - b) * (p - b) >= 0);
}

bool point_in_triangle(Point a, Point b, Point c, Point p)
{
    ll v1 = (b - a) % (p - a);
    ll v2 = (c - b) % (p - b);
    ll v3 = (a - c) % (p - c);
    return (v1 >= 0 && v2 >= 0 && v3 >= 0) || (v1 <= 0 && v2 <= 0 && v3 <= 0);
}

bool point_in_convex_polygon(vector<Point> &a, Point p)
{
    int n = sz(a);
    if ((a[1] - a[0]) % (p - a[0]) < 0)
        return false;
    else if ((a[1] - a[0]) % (p - a[0]) == 0)
        return point_in_segment(a[0], a[1], p);
    if ((a[n - 1] - a[0]) % (p - a[0]) > 0)
        return false;
    else if ((a[n - 1] - a[0]) % (p - a[0]) == 0)
        return point_in_segment(a[0], a[n - 1], p);
    int l = 1, r = n - 1, mid;
    while (r - l > 1)
    {
        mid = (l + r) / 2;
        if ((a[mid] - a[0]) % (p - a[0]) >= 0)
            l = mid;
        else
            r = mid;
    }
    return point_in_triangle(a[0], a[l], a[l + 1], p);
}

struct Line
{
    ll a, b, c;
    Line() {}
    Line(ll a, ll b, ll c) : a(a), b(b), c(c) {}
    Line(Point p1, Point p2) { a = p2.y - p1.y; b = -(p2.x - p1.x); c = p2 % p1; }
    ll val(Point p) { return a * p.x + b * p.y + c; }
};

bool line_in_convex_polygon(vector<Point> &a, Line line)
{
    int n = sz(a);
    int mi_id, ma_id;
    if (line.val(a[1]) >= line.val(a[0]))
    {
        int l = 0, r = n, mid;
        while (r - l > 1)
        {
            mid = (l + r) / 2;
            if (line.val(a[mid]) >= line.val(a[mid - 1]))
            {
                if (line.val(a[mid]) >= line.val(a[0]))
                    l = mid;
                else
                    r = mid;
            }
            else
            {
                r = mid;
            }
        }
        ma_id = l;
        l = 0; r = n;
        while (r - l > 1)
        {
            mid = (l + r) / 2;
            if (line.val(a[(mid + 1) % n]) >= line.val(a[mid]))
            {
                if (line.val(a[mid]) >= line.val(a[0]))
                    l = mid;
                else
                    r = mid;
            }
            else
            {
                l = mid;
            }
        }
        mi_id = r % n;
    }
    else
    {
        int l = 0, r = n, mid;
        while (r - l > 1)
        {
            mid = (l + r) / 2;
            if (line.val(a[(mid + 1) % n]) <= line.val(a[mid]))
            {
                if (line.val(a[mid]) <= line.val(a[0]))
                    l = mid;
                else
                    r = mid;
            }
            else
            {
                l = mid;
            }
        }
        ma_id = r % n;
        l = 0; r = n;
        while (r - l > 1)
        {
            mid = (l + r) / 2;
            if (line.val(a[mid]) <= line.val(a[mid - 1]))
            {
                if (line.val(a[mid]) <= line.val(a[0]))
                    l = mid;
                else
                    r = mid;
            }
            else
            {
                r = mid;
            }
        }
        mi_id = l;
    }
    return line.val(a[mi_id]) <= 0 && line.val(a[ma_id]) >= 0;
}

bool comp3(Point a, Point b)
{
    if (a.y >= 0 && b.y < 0)
        return true;
    else if (a.y < 0 && b.y >= 0)
        return false;
    else if (a.y == 0 && b.y == 0)
        return a.x > b.x;
    else
        return a % b > 0;
}

vector<Point> minkovski(vector<Point> a, vector<Point> b)
{
    a = convex_hull(a);
    b = convex_hull(b);
    vector<Point> p;
    rep(i, 0, sz(a))
        p.push_back(a[(i + 1) % sz(a)] - a[i]);
    rep(i, 0, sz(b))
        p.push_back(b[(i + 1) % sz(b)] - b[i]);
    sort(p.begin(), p.end(), comp3);
    vector<Point> res(sz(p));
    res[0] = a[0] + b[0];
    rep(i, 0, sz(p) - 1)
        res[i + 1] = res[i] + p[i];
    res = convex_hull(res);
    return res;
}

int main()
{
    //freopen("theodore.in", "r", stdin);
    //freopen("theodore.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    cout << fixed;
    //ll TL = 0.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    vector<vector<Point> > aaa(3);
    rep(i, 0, 3)
    {
        int n;
        cin >> n;
        aaa[i].resize(n);
        rep(j, 0, n)
            cin >> aaa[i][j].x >> aaa[i][j].y;
    }
    vector<Point> a = minkovski(minkovski(aaa[0], aaa[1]), aaa[2]);
    int m;
    cin >> m;
    rep(i, 0, m)
    {
        Point p;
        cin >> p.x >> p.y;
        p.x *= 3; p.y *= 3;
        cout << (point_in_convex_polygon(a, p) ? "YES\n" : "NO\n");
    }
    return 0;
}

#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

typedef long double db;

const db inf=(db)1./0;

const int N=50005;

int tot,p;

struct vec{
	db x,y;
	vec(){
	}
	vec(db _x,db _y):x(_x),y(_y){
	}
	friend vec operator + (const vec &a,const vec &b){
		return vec(a.x+b.x,a.y+b.y);
	}
	friend vec operator - (const vec &a,const vec &b){
		return vec(a.x-b.x,a.y-b.y);
	}
	db atan2() const{
		return ::atan2(y,x);
	}
} O,a[N*3],b[N*3];

db cross(const vec &a,const vec &b){
	return a.x*b.y-a.y*b.x;
}

bool cmpang(const vec &a,const vec &b){
	return a.atan2()<b.atan2();
}

bool cmpy_l(const vec &a,const vec &b){
	return a.y<b.y;
}

bool cmpy_g(const vec &a,const vec &b){
	return a.y>b.y;
}

vec getvec(){
	double x,y; scanf("%lf%lf",&x,&y);
	return vec((db)x,(db)y);
}

void putvec(const vec &a){
	printf("(%lf,%lf)",(double)a.x,(double)a.y);
}

db xul=+inf,xur=-inf,xdl=+inf,xdr=-inf;

bool check(vec P){
	if(P.y>a[0].y||P.y<a[p].y) return false;
	if(P.y==a[0].y)
		return P.x>=xul&&P.x<=xur;
	if(P.y==a[p].y)
		return P.x>=xdl&&P.x<=xdr;
	int loc=upper_bound(a,a+p,P,cmpy_g)-a-1;
	if(cross(b[loc],P-a[loc])<0) return false;
	loc=upper_bound(a+p,a+tot,P,cmpy_l)-a-1;
	if(cross(b[loc],P-a[loc])<0) return false;
	return true;
}

int main(){
	for(int _=0;_<3;_++){
		int n; scanf("%d",&n);
		int p=0;
		for(int i=0;i<n;i++){
			a[i]=getvec();
			if(a[i].y>a[p].y||a[i].y==a[p].y&&a[i].x<a[p].x) p=i;
		}
		for(int i=0;i<p;i++) a[n+i]=a[i];
		for(int i=0;i<n;i++) a[i]=a[i+p];
		O=O+a[0];
		a[n]=a[0];
		for(int i=0;i<n;i++) b[tot+i]=a[i+1]-a[i];
		inplace_merge(b,b+tot,b+tot+n,cmpang);
		tot+=n;
	}
	a[0]=O;
	for(int i=0;i<tot;i++) a[i+1]=a[i]+b[i];
	for(p=0;b[p].atan2()<=0;p++);
	for(int i=0;i<tot;i++){
		if(a[i].y==a[0].y){
			xul=min(xul,a[i].x);
			xur=max(xur,a[i].x);
		}
		if(a[i].y==a[p].y){
			xdl=min(xdl,a[i].x);
			xdr=max(xdr,a[i].x);
		}
	}
	int q; scanf("%d",&q);
	while(q--){
		vec P=getvec(); P.x*=3; P.y*=3;
		puts(check(P)?"YES":"NO");
	}
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

ll mod = 1e9+7;
const double error = 1e-7;
const double PI = acos(-1); //const ld PI = acosl(-1)

#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define eq(x, y) (fabs((x)-(y))<error)
#define bt(i) (1LL<<(i))

#define debug(x) cerr<<#x<<" = "<<(x)<<"\n"
#define hoise cerr<<"hoise\n"
#define tham getchar()
mt19937 rng((unsigned int) chrono::system_clock::now().time_since_epoch().count());

inline ll MOD(ll x, ll m = mod)
{
    ll y = x % m;
    return (y >= 0) ? y: y+m;
}

const int inf = 1e9+2;
const ll infl = 1e18+1;
const int nmax = 1e5+5;
///====================== template =========================

typedef ll T;
typedef complex<T> point;
#define X real()
#define Y imag()

#define dot(p, q) ((conj(p)*(q)).X)
#define cross(p, q) ((conj(p)*(q)).Y)
#define orient(p, q, r) cross((q)-(p), (r)-(p))

bool operator==(point p, point q){
    return (p.X == q.X) && (p.Y == q.Y);
}

bool lexcomp(const point &p, const point &q){	//lexicographical comparator
    return make_pair(p.X, p.Y) < make_pair(q.X, q.Y);
}

point origin, ray;

inline bool half(point p){
    return cross(ray, p) < 0 || (cross(ray, p) == 0 && dot(ray, p) > 0);
}

bool polarComp(point p, point q){
	p -= origin;
	q -= origin;
    return make_tuple(half(p), 0) < make_tuple(half(q), cross(p, q));
}

//A+B = C;  A, B have bottom-left at index 0
void MinkowskiSum(vector<point> &A, vector<point> &B, vector<point> &C){
    int n = A.size(), m = B.size();
    vector<point> P(n), Q(m);

    for(int i = 0; i+1<n; i++) P[i] = A[i+1] - A[i];
    P[n-1] = A[0] - A[n-1];

    for(int i = 0; i+1<m; i++) Q[i] = B[i+1] - B[i];
    Q[m-1] = B[0] - B[m-1];

    origin = point(0, 0), ray = point(0, -1);
    C.resize(n+m+1);
    merge(P.begin(), P.end(), Q.begin(), Q.end(), C.begin()+1, polarComp);

    C[0] = A[0] + B[0];

//    for(auto p: C) debug(p);
    for(int i = 1; i < C.size(); i++) C[i] += C[i-1];
    assert(C[0] == C.back());
    C.pop_back();
}

ll PointInPoly(point p, vector<point> &poly, int top){
    if(lexcomp(p, poly[0]) || lexcomp(poly[top], p)) return -1;

    auto o = orient(poly[0], poly[top], p);
    if(o == 0){
        return (p == poly[0] || p == poly[top] ||
           top == 1 || top+1 == poly.size())? 0 : 1;
    }
    else if(o < 0){
        auto it = lower_bound(poly.begin(), poly.begin()+top, p, lexcomp);
        return orient(it[-1], it[0], p);
    }
    else{
        auto it = upper_bound(poly.rbegin(), poly.rend()-top-1, p, lexcomp);
        return orient(p, it[0], (it == poly.rbegin())? poly[0] : it[-1]);
    }
}
//0 = on, +ve = inside, -ve = outside

vector<point> poly[3], sum;
int main(){
    FASTIO;

    for(int i = 0; i<3; i++){
        int n;
        cin>>n;
        poly[i].resize(n);

        for(int j = 0; j<n; j++)
        {
            ll x, y;
            cin>>x>>y;
            poly[i][j] = point(x, y);
        }

        auto it = min_element(poly[i].begin(), poly[i].end(), lexcomp);
        rotate(poly[i].begin(), it, poly[i].end());

    }

    MinkowskiSum(poly[0], poly[1], sum);

    MinkowskiSum(sum, poly[2], sum);

    int top = max_element(sum.begin(), sum.end(), lexcomp) - sum.begin();

    int m;
    cin>>m;
    for(int i = 0; i<m; i++)
    {
        ll x, y;
        cin>>x>>y;
        point p(x, y);
        p *= 3;
        if(PointInPoly(p, sum, top) < 0) cout<<"NO\n";
        else cout<<"YES\n";
    }

}

#pragma comment(linker, "/STACK:65777216")

#include <algorithm>
#include <iostream>
#include <string>
#include<sstream>
#include<string.h>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include<stack>
#include <set>
#include <map>
#include<ctime>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef unsigned long long ull;

#define FOR(i,a,b) for (int i(a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define SORT(v) sort((v).begin(),(v).end())
#define UN(v) sort((v).begin(),(v).end()),v.erase(unique(v.begin(),v.end()),v.end())
#define CL(a,b) memset(a,b,sizeof(a))
#define pb push_back

int n;
int m;
int x[222222];
int y[222222];
int X[211111];
int Y[211111];
int xt[222222];
int yt[222222];
double mn[111111];
double MX[111111];

void change(int *x,int *y,int n){
	int pos = 0;
	REP(i,n)if(x[i] < x[pos] || x[i] == x[pos] && y[i] > y[pos])
		pos = i;
	REP(i,n) xt[i] = x[(i+pos)%n],yt[i]=y[(i+pos)%n];
	REP(i,n) x[i] =xt[i], y[i]=yt[i];
}

bool better(ll x,ll y,ll x1,ll y1,ll x2,ll y2){
	ll q = (x1-x)*(y2-y)-(x2-x)*(y1-y);
	if(q) return q<0;
	return (x-x1)*(x-x1)+(y-y1)*(y-y1) > (y-y2)*(y-y2)+(x-x2)*(x-x2);
}

void un(){
	int N=0;

	x[n] = x[0],y[n] = y[0];
	X[m] = X[0],Y[m] = Y[0];

	int p1 = 0;
	int p2 = 0;

	while(1){
		xt[N] = x[p1] + X[p2];
		yt[N] = y[p1] + Y[p2];
		N++;
		if(N == n + m) break;

		int x1 = x[p1] + X[p2+1];
		int y1 = y[p1] + Y[p2+1];
		int x2 = x[p1+1] + X[p2];
		int y2 = y[p1+1] + Y[p2];

		if(better(xt[N-1],yt[N-1],x1,y1,x2,y2)) p2++;
		else p1++;
	}

	REP(i,N) x[i]=xt[i],y[i]=yt[i];
	n=N;

	/*puts("begin");
	REP(i,N) {
		cout<<x[i]<<' '<<y[i]<<endl;
	}
	puts("end");*/
}

typedef pair<pii,int> p3;
p3 p[111111];

const double eps = 1e-9;

int main(){
#ifdef LocalHost
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
#endif

	cin>>n;
	REP(j,n) scanf("%d %d",&x[j],&y[j]);
	reverse(x,x+n);
	reverse(y,y+n);
	change(x,y,n);
	REP(i,2){
		cin>>m;
		REP(j,m) scanf("%d %d",&X[j],&Y[j]);
		reverse(X,X+m);
		reverse(Y,Y+m);
		change(X,Y,m);
		un();
	}
	cin>>m;
	REP(i,m){
		scanf("%d %d",X+i,Y+i);
		p[i] = p3(pii(3*X[i],Y[i]),i);
		mn[i] = 1e100;
		MX[i] = -1e100;
	}
	sort(p,p+m);
	x[n] = x[0], y[n] = y[0];
	REP(i,n){
		int xf = min(x[i],x[i+1]);
		int xe = max(x[i],x[i+1]);
		int pos = lower_bound(p,p+m,p3(pii(xf,-2000000000),0))-p;
		while(pos<m){
			if(p[pos].first.first > xe) break;
			int ver = p[pos].second;
			if(xf == xe){
				mn[ver] =  min(mn[ver], 0.+min(y[i],y[i+1]));
				MX[ver] =  max(MX[ver], 0.+max(y[i],y[i+1]));
			}else{
				double Y = y[i] + (y[i+1]-y[i])*double(p[pos].first.first - x[i])/double(x[i+1]-x[i]);
				mn[ver] =  min(mn[ver], Y);
				MX[ver] =  max(MX[ver], Y);
			}

			pos++;
		}
	}
	REP(i,m){
		puts(3*Y[i]>=mn[i]-eps && 3*Y[i]<=MX[i]+eps ? "YES":"NO");
		//cout<<
	}

#ifdef LocalHost
	cout<<endl<<endl<<"TIME: "<<clock()<<endl;
#endif
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

inline int sign(LL x) {
	if (x < 0) {
		return -1;
	}
	if (x > 1) {
		return 1;
	}
	return 0;
}

struct point {
	LL x, y;
	point() {}
	point(LL _x, LL _y) : x(_x), y(_y) {}
};

bool operator < (const point &a, const point &b) {
	if (a.y != b.y) {
		return a.y < b.y;
	}
	return a.x < b.x;
}

bool operator == (const point &a, const point &b) {
    return !(a < b) && !(b < a);
}

point operator + (const point &a, const point &b) {
	return point(a.x + b.x, a.y + b.y);
}

point operator - (const point &a, const point &b) {
	return point(a.x - b.x, a.y - b.y);
}

LL dot(const point &a, const point &b) {
	return a.x * b.x + a.y * b.y;
}

LL cross(const point &a, const point &b) {
	return a.x * b.y - a.y * b.x;
}

typedef vector <point> polygon;

void readPolygon(polygon &p) {
	int n;
	cin >> n;
	p.resize(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i].x >> p[i].y;
	}
}

inline void normalize(polygon &a) {
    a.erase(unique(a.begin(), a.end()), a.end());
    while (a.size() > 1 && a.back() == a[0]) {
        a.pop_back();
    }
    rotate(a.begin(), min_element(a.begin(), a.end()), a.end());
}

polygon minkowskySum(polygon a, polygon b) {
	normalize(a);
	normalize(b);
	polygon result;
	result.push_back(a[0] + b[0]);
	int posA = 0;
	int posB = 0;
	point lastVector(1, 0);
	while (posA != a.size() || posB != b.size()) {
		if (posA != a.size() && posB != b.size()) {
			point newVectorA = a[(posA + 1 == a.size()) ? 0 : posA + 1] - a[posA];
			point newVectorB = b[(posB + 1 == b.size()) ? 0 : posB + 1] - b[posB];
			if (cross(newVectorA, newVectorB) > 0) {
				point newPoint = result.back() + newVectorA;
				result.push_back(newPoint);
				lastVector = newVectorA;
				posA++;
			} else {
				point newPoint = result.back() + newVectorB;
				result.push_back(newPoint);
				lastVector = newVectorB;
				posB++;
			}
		} else if (posA != a.size() && posB == b.size()) {
			point newVector = a[(posA + 1 == a.size()) ? 0 : posA + 1] - a[posA];
			point newPoint = result.back() + newVector;
			result.push_back(newPoint);
			posA++;
		} else if (posA == a.size() && posB != b.size()){
			point newVector = b[(posB + 1 == b.size()) ? 0 : posB + 1] - b[posB];
			point newPoint = result.back() + newVector;
			result.push_back(newPoint);
			posB++;
		}
	}
	assert(result.back() == result[0]);
	result.pop_back();
	return result;
}

bool contains(const point &p, const polygon &poly, int upper) {
	if (p.y < poly[0].y || p.y > poly[upper].y) {
		return false;
	}
	{
		int lo = 0;
		int hi = upper - 1;
		int pos = 0;
		while (lo <= hi) {
			int mid = (lo + hi) >> 1;
			if (poly[mid].y <= p.y) {
				pos = mid;
				lo = mid + 1;
			} else {
				hi = mid - 1;
			}
		}
		if (cross(p - poly[pos], poly[pos + 1] - poly[pos]) > 0) {
			return false;
		}
	}
	{
		int lo = upper;
		int hi = poly.size() - 1;
		int pos = upper;
		while (lo <= hi) {
			int mid = (lo + hi) >> 1;
			if (poly[mid].y >= p.y) {
				pos = mid;
				lo = mid + 1;
			} else {
				hi = mid - 1;
			}
		}
		if (cross(p - poly[pos], poly[(pos + 1 == poly.size()) ? 0 : pos + 1] - poly[pos]) > 0) {
			return false;
		}
	}
	return true;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//freopen("dat.txt", "r", stdin);

	polygon a, b, c;
	readPolygon(a);
	readPolygon(b);
	readPolygon(c);

	polygon s = minkowskySum(a, minkowskySum(b, c));
	normalize(s);

	int upper = 1;
	while (s[upper].y == s[0].y) {
        upper++;
	}
	while (upper + 1 < s.size() && s[upper + 1].y > s[upper].y) {
		upper++;
	}

	int m;
	cin >> m;
	while (m--) {
		int x, y;
		cin >> x >> y;
		cout << (contains(point(3LL * x, 3LL * y), s, upper) ? "YES" : "NO") << "\n";
	}
}

// meow-meow
#pragma GCC optimize("O3", "unroll-loops")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = min((a), (b))
#define maxeq(a, b) (a) = max((a), (b))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

struct vect {
	ll x, y;
	vect() {}
	vect(ll x1, ll y1) {
		x = x1, y = y1;
	}
	vect operator + (vect &a) {
		return vect(x + a.x, y + a.y);
	}
	vect operator - (vect &a) {
		return vect(x - a.x, y - a.y);
	}
	ll operator * (vect &a) {
		return x * a.x + y * a.y;
	}
	ll operator % (vect &a) {
		return x * a.y - y * a.x;
	}
	vect operator * (ll k) {
		return vect(x*k, y*k);
	}
	vect rotate(ld a) {
		return vect(x*cos(a) - y * sin(a), x*sin(a) + y * cos(a));
	}
	bool operator == (vect a) {
		return pll(x, y) == pll(a.x, a.y);
	}
	bool operator < (vect &a) {
		return pll(y, x) < pll(a.y, a.x);
	}
};

bool comp(vect &a, vect &b) {
	if (a.y >= 0 && b.y < 0) {
		return true;
	}
	if (a.y < 0 && b.y >= 0) {
		return false;
	}
	if (a.y == 0 && b.y == 0) {
		if (a.x > 0 && b.x < 0) {
			return true;
		} else if (a.x < 0 && b.x > 0) {
			return false;
		}
		return a.x < b.x;
	}
	ll p = a % b;
	if (p == 0) {
		return a * a < b * b;
	}
	return p > 0;
}

vector<vect> x1, x2, x3;
vector<vect> mink;
vect O;

vector<vect> get(vector<vect> &a, vector<vect> &b, vector<vect> &c) {
	vector<vect> d;

	a.pb(a[0]);
	for (ll i = 0; i < sz(a) - 1; i++) {
		d.pb(a[i + 1] - a[i]);
	}
	a.popb();
	sort(all(a));

	b.pb(b[0]);
	for (ll i = 0; i < sz(b) - 1; i++) {
		d.pb(b[i + 1] - b[i]);
	}
	b.popb();
	sort(all(b));

	c.pb(c[0]);
	for (ll i = 0; i < sz(c) - 1; i++) {
		d.pb(c[i + 1] - c[i]);
	}
	c.popb();
	sort(all(c));

	sort(all(d), comp);

	vect A = a[0] + b[0] + c[0];

	vector<vect> res;
	res.pb(A);
	res.pb(res.back() + d[0]);
	for (ll i = 1; i < sz(d); i++) {
		if (d[i] == vect(0, 0)) {
			continue;
		}
		vect v1 = (res.back() + d[i]) - res.back();
		vect v2 = res.back() - res[sz(res) - 2];
		ll p = v1 % v2;
		if (p == 0) {
			res[sz(res) - 1] = res.back() + d[i];
			continue;
		}
		res.pb(res.back() + d[i]);
	}
	return res;
}

int sign(ll a) {
	if (a > 0) {
		return 1;
	} else if (a < 0) {
		return -1;
	} else {
		return 0;
	}
}

bool check(vect P, vect A, vect B) {
	vect OP = P - O, OA = A - O, OB = B - O;
	ll p1 = OP % OA, p2 = OA % OB;
	return sign(p1) != sign(p2);
}

bool triangle(vect P, vect A, vect B, vect C) {
	vect PA = A - P, PB = B - P, PC = C - P, AB = B - A, AC = C - A;
	ull s1 = ull(abs(PA % PB)) + ull(abs(PB % PC)) + ull(abs(PC % PA));
	ull s2 = abs(AB % AC);
	return s1 == s2;
}

bool solve(vect P) {
	ll n = sz(mink);
	ll l = -1, r = n - 1;
	while (r - l > 1) {
		ll m = (l + r) / 2;
		if (check(P, mink[m], mink[m + 1])) {
			l = m;
		} else {
			r = m;
		}
	}
	if (l == -1) {
		return false;
	}
	return triangle(P, O, mink[l], mink[l + 1]);
}

void solve() {
	ll m;
	cin >> m;
	mink = get(x1, x2, x3);
	mink.popb();
	O = mink.back();
	mink.popb();
	for (ll i = 0; i < m; i++) {
		vect P;
		cin >> P.x >> P.y;
		P.x *= 3, P.y *= 3;
		bool ans = solve(P);
		if (ans) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

void change(vector<vect> &a) {
	ll n;
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i].x >> a[i].y;
	}
}

void read() {
	change(x1);
	change(x2);
	change(x3);
}

int main() {
	fast;
	read();
	solve();
	return 0;
}

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <array>
using namespace std;

#ifdef _LOCAL_
#define LLD "%lld"
#else
#define LLD "%I64d"
#endif

#define prev pppppppprev
#define next nnnnnnnnext

#ifdef _LOCAL_
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define DB(args...) DBin(#args, args)
#define DBcont(cont) cerr<<__LINE__<<": "<<#cont<<" = ", print_cont(cont)
#else
#define eprintf(...) static_cast<void>(0)
#define DB(args...) static_cast<void>(0)
#define DBcont(cont) static_cast<void>(0)
#endif
void DBcontinue() {}
template <typename T, typename... Args>
void DBcontinue(T head, Args... tail)
{
    char *head_name = strtok(NULL, ", ");
    cerr << "," << string(head_name) << "=" << head;
    DBcontinue(tail...);
}
template <typename T, typename... Args>
void DBin(const char *names, T head, Args... tail)
{
    char *names_buf = new char[strlen(names) + 1];
    strcpy(names_buf, names);
    char *head_name = strtok(names_buf, ", ");
    cerr << __LINE__ << ": " << string(head_name) << "=" << head;
    DBcontinue(tail...);
    cerr << "\n";
    delete[] names_buf;
}
template <class Container>
void print_cont(const Container &cont)
{
    cerr << "{ ";
    for(auto it = begin(cont); it != end(cont); ++it)
    {
        if(it != begin(cont))
            cerr << ", ";
        cerr << *it;
    }
    cerr << " }\n";
}

#define rep(x,y,z) for (int x = (y), e##x = (z);x < e##x; x++)
typedef long long ll;
typedef pair<int,int> pii;

struct v2ll
{
    ll x,y;
    v2ll operator +(const v2ll &v) const
    {
        return {x + v.x, y + v.y};
    }
    v2ll operator -(const v2ll &v) const
    {
        return {x - v.x, y - v.y};
    }
    v2ll operator *(const ll &t) const
    {
        return {t * x, t * y};
    }
    ll operator *(const v2ll &v) const
    {
        return x * v.x + y * v.y;
    }
    ll operator ^(const v2ll &v) const
    {
        return x * v.y - y * v.x;
    }
    bool operator ==(const v2ll &v) const
    {
        return x == v.x && y == v.y;
    }
    void scan()
    {
        scanf(LLD, &x);
        scanf(LLD, &y);
    }
    friend istream& operator >>(istream &in, v2ll &v);
    friend ostream& operator <<(ostream &out, const v2ll &v);
};
istream& operator >>(istream &in, v2ll &v)
{
    in >> v.x >> v.y;
    return in;
}
ostream& operator <<(ostream &out, const v2ll &v)
{
    out << (v.x) << " " << (v.y);
    return out;
}

/*void remove_ints(vector<v2ll> &A)
{
    int n = A.size(), nn = 0, i = 0, pi = n - 1, ni = 1;
    for(int processed = 0; processed < n;)
    {
        for(; ((A[ni] - A[i]) ^ (A[pi] - A[i])) == 0; pi = i, i = ni, ni = (i + 1) % n, ++processed);
        A[nn++] = A[i];
    }
}*/
vector<v2ll> minkowski_sum(const vector<v2ll> &A, const vector<v2ll> &B)
{
    int nA = A.size(), nB = B.size(), i, ni, j, nj;
    auto cmp_coords = [](const v2ll&a, const v2ll&b) {return (a.x < b.x || a.x == b.x && a.y < b.y);};
    i = min_element(A.begin(), A.end(), cmp_coords) - A.begin();
    ni = (i + 1) % nA;
    j = min_element(B.begin(), B.end(), cmp_coords) - B.begin();
    nj = (j + 1) %nB;
    vector<v2ll> ret;
    //v2ll dir = {-1,0};
    for(int processed = 0; processed < nA + nB;)
    {
        ret.push_back(A[i] + B[j]);
        ll cr = ((A[ni] - A[i]) ^ (B[nj] - B[j]));
        if(cr > 0)
            i = ni, ni = (i + 1) % nA, ++processed;
        else if(cr < 0)
            j = nj, nj = (j + 1) % nB, ++processed;
        else
        {
            i = ni, ni = (i + 1) % nA;
            j = nj, nj = (j + 1) % nB;
            processed += 2;
        }
    }
    return ret;
}
bool in_convex_polygon(const v2ll &P, const vector<v2ll> &A)
{
    int n = A.size();
    if(P == A[0])
        return true;
    if( ((A[0] - A[n-1]) ^ (P - A[0])) < 0 ||
            ((A[1] - A[0]) ^ (P - A[0])) < 0 )
        return false;
    int i = lower_bound( A.begin() + 1, A.end(), P, [&](const v2ll &a, const v2ll &b)
                                                        {
                                                            return ((a - A[0]) ^ (b - A[0])) > 0;
                                                        } ) - A.begin();
    DB(i);
    if( ((P - A[0]) ^ (A[i] - A[0])) == 0 )
        return ((A[0] - P) * (A[i] - P)) <= 0;
    return ((A[i] - A[i-1]) ^ (P - A[i])) >= 0;
}

void run()
{
    vector<v2ll> A[3], S;
    v2ll P;
    for(int ip = 0; ip < 3; ++ip)
    {
        int n;
        scanf("%d", &n);
        for(int i = 0; i < n; ++i)
        {
            P.scan();
            A[ip].push_back(P);
        }
    }
    S = minkowski_sum(A[0], A[1]);
    DBcont(S);
    S = minkowski_sum(S, A[2]);
    DBcont(S);
    int m;
    scanf("%d", &m);
    for(int i = 0; i < m; ++i)
    {
        P.scan();
        P = P * 3;
        puts(in_convex_polygon(P, S) ? "YES" : "NO");
    }
}

//#define file_name "barduck"

int main()
{
#ifdef _LOCAL_
    if(freopen("input.txt", "r", stdin) == NULL)
    {
        printf("Can't open input.txt\n");
        return 0;
    }
#else
#ifdef file_name
    freopen(file_name".in", "r", stdin);
    freopen(file_name".out", "w", stdout);
#endif
#endif
    run();
#ifdef _LOCAL_
    //puts("================");
#endif

    return 0;
}

#include<algorithm>
#include<cstdio>
#include<cmath>
#define LD double
#define LL long long
#define Re register int
#define Vector Point
using namespace std;
const int N=5e4+3;
const LD eps=1e-8,Pi=acos(-1.0);
inline int dcmp(LD a){return a<-eps?-1:(a>eps?1:0);}
inline LD Abs(LD a){return a*dcmp(a);}
inline void in(Re &x){
    int f=0;x=0;char c=getchar();
    while(c<'0'||c>'9')f|=c=='-',c=getchar();
    while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
    x=f?-x:x;
}
struct Point{
    LD x,y;Point(LD X=0,LD Y=0){x=X,y=Y;}
    inline void In(){Re X,Y;in(X),in(Y),x=X,y=Y;}
    inline bool operator<(const Point &O)const{return dcmp(x-O.x)?x<O.x:y<O.y;}
};
inline LD Dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;}
inline LD Cro(Vector a,Vector b){return a.x*b.y-a.y*b.x;}
inline LD Len(Vector a){return sqrt(Dot(a,a));}
inline Vector Normal(Vector a){return Vector(-a.y,a.x);}
inline Vector operator+(Vector a,Vector b){return Vector(a.x+b.x,a.y+b.y);}
inline Vector operator-(Vector a,Vector b){return Vector(a.x-b.x,a.y-b.y);}
inline Vector operator*(Vector a,LD b){return Vector(a.x*b,a.y*b);}
inline bool operator==(Point a,Point b){return !dcmp(a.x-b.x)&&!dcmp(a.y-b.y);}
inline int pan_PL(Point p,Point a,Point b){
	return !dcmp(Cro(p-a,p-b))&&dcmp(Dot(p-a,p-b))<0;
}
inline bool cmp1(Vector a,Vector b){return a.x==b.x?a.y<b.y:a.x<b.x;};
inline int ConvexHull(Point *P,Re n,Point *cp){
    sort(P+1,P+n+1,cmp1);
    Re t=0;
    for(Re i=1;i<=n;++i){
        while(t>1&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    Re St=t;
    for(Re i=n-1;i>=1;--i){
        while(t>St&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    return --t;
}
inline int PIP(Point *P,Re n,Point a){
	if(dcmp(Cro(a-P[1],P[2]-P[1]))>0||dcmp(Cro(P[n]-P[1],a-P[1]))>0)return 0;
	if(pan_PL(a,P[1],P[2])||pan_PL(a,P[1],P[n]))return 1;
	Re l=2,r=n-1;
	while(l<r){
		Re mid=l+r+1>>1;
		if(dcmp(Cro(a-P[1],P[mid]-P[1]))>0)r=mid-1;
		else l=mid;
	}
	return dcmp(Cro(a-P[r],P[r+1]-P[r]))<=0;
}
Vector V1[N*3],V2[N*3];
inline int Mincowski(Point *P1,Re n,Point *P2,Re m,Point *P){
	for(Re i=1;i<=n;++i)V1[i]=P1[i<n?i+1:1]-P1[i];
	for(Re i=1;i<=m;++i)V2[i]=P2[i<m?i+1:1]-P2[i];
	Re t=0,i=1,j=1;P[++t]=P1[1]+P2[1];
	while(i<=n&&j<=m)++t,P[t]=P[t-1]+(dcmp(Cro(V1[i],V2[j]))>0?V1[i++]:V2[j++]);
	while(i<=n)++t,P[t]=P[t-1]+V1[i++];
	while(j<=m)++t,P[t]=P[t-1]+V2[j++];
	return t;
}
int n,T,n1,n2,n3;Point Q,P[N*3],cp[N*3],P1[N],P2[N],P3[N];
int main(){
//	freopen("123.txt","r",stdin);
	in(n1);for(Re i=1;i<=n1;++i)P1[i].In();n1=ConvexHull(P1,n1,cp);for(Re i=1;i<=n1;++i)P1[i]=cp[i];
	in(n2);for(Re i=1;i<=n2;++i)P2[i].In();n2=ConvexHull(P2,n2,cp);for(Re i=1;i<=n2;++i)P2[i]=cp[i];
	in(n3);for(Re i=1;i<=n3;++i)P3[i].In();n3=ConvexHull(P3,n3,cp);for(Re i=1;i<=n3;++i)P3[i]=cp[i];
	n=Mincowski(P1,n1,P2,n2,P),n=Mincowski(P,n,P3,n3,cp),n=ConvexHull(cp,n,P),in(T);
	while(T--)Q.In(),puts(PIP(P,n,Q*3.0)?"YES":"NO");
}

#include <bits/stdc++.h>

using namespace std;

struct point {
  	long long x, y;
  	point() {}
  	point(long long x, long long y): x(x), y(y) {}
  	point operator + (point a) const {
  		return point(x + a.x, y + a.y);
  	}
  	point operator - (point a) const {
  		return point(x - a.x, y - a.y);
  	}
  	long long operator * (point a) const {
  		return x * a.y - y * a.x;
  	}
  	point operator * (int a) const {
  		return point(a * x, a * y);
  	}
  	bool operator << (point const & a) const {
  		return x < a.x || x == a.x && y < a.y;
  	}
  	bool operator < (point const & a) const {
  		long long mul = (*this) * a;
  		return mul > 0;
  	}
  	bool operator <= (point const & a) const {
  		long long mul = (*this) * a;
  		return mul >= 0;
  	}
};

int first(vector<point> const & a) {
	int ret = 0;
	for (int i = 1; i < (int)a.size(); ++i) {
		if (a[i] << a[ret]) {
			ret = i;
		}
	}
	return ret;
}

vector<point> sum(vector<point> const & a, vector<point> const & b) {
	int n = a.size(), m = b.size();
	if (n == 0) {
		return b;
	}
	if (m == 0) {
		return a;
	}
	int p = first(a), q = first(b);
	vector<point> x(n), y(m), z(n + m);
	for (int it = 0; it < n; ++it) {
		int i = (it + p) % n;
		int j = (i + 1) % n;
		x[it] = (a[j] - a[i]);
	}
	for (int it = 0; it < m; ++it) {
		int i = (it + q) % m;
		int j = (i + 1) % m;
		y[it] = (b[j] - b[i]);
	}
	merge(x.begin(), x.end(), y.begin(), y.end(), z.begin());
	vector<point> ret(n + m);
	ret[0] = a[p] + b[q];
	for (int i = 1; i < n + m; ++i) {
		ret[i] = ret[i - 1] + z[i - 1];
	}
	return ret;
}

bool isIn(vector<point> const & a, point p) {
	int n = (int)a.size();
	int l = 1, r = n - 1;
	bool ret = a[l] <= p && p <= a[r];
	while (r - l > 1) {
		int m = (l + r) / 2;
		if (p < a[m]) {
			r = m;
		} else {
			l = m;
		}
	}
	ret &= (a[r] - a[l]) <= (p - a[l]);
	ret &= (p - a[r]) <= (a[l] - a[r]);
	return ret;
}

int main() {
	vector<point> s(0);
	point f;
	for (int it = 0; it < 3; ++it) {
		int n;
		scanf("%d", &n);
		vector<point> a(n);
		for (int i = 0; i < n; ++i) {
			scanf("%I64d%I64d", &a[i].x, &a[i].y);
		}
		s = sum(s, a);
		int k = first(s);
		f = s[k];
		vector<point> t(0);
		for (int it = 0; it < (int)s.size(); ++it) {
			int i = (it + k) % (int)s.size();
			while ((int)t.size() > 1 && (t[(int)t.size() - 1] - t[(int)t.size() - 2]) * (s[i] - t[(int)t.size() - 2]) == 0) {
				t.pop_back();
			}
			t.push_back(s[i]);
		}
		int sz = t.size();
		if ((t[sz - 1] - t[sz - 2]) * (t[0] - t[sz - 2]) == 0) {
			t.pop_back();
		}
		s = t;
	}
        for (int i = 0; i < (int)s.size(); ++i) {
		s[i] = s[i] - f;
	}
	int m;
	scanf("%d", &m);
	for (int i = 0; i < m; ++i) {
		point p;
		scanf("%I64d%I64d", &p.x, &p.y);
		p = p * 3 - f;
		puts(isIn(s, p) ? "YES" : "NO");
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ab(x) ((x) < 0 ? -(x) : (x))
using namespace std;
typedef long long LL;
typedef map<int, int>::iterator mit;
typedef pair<int, int> pii;
typedef set<pii>::iterator sit;
#define x first
#define y second
const int N = 2e5 + 10;
int n;
pii a[N], b[N];
pii operator + (const pii &a, const pii &b) { return mp(a.x + b.x, a.y + b.y); }
pii operator - (const pii &a, const pii &b) { return mp(a.x - b.x, a.y - b.y); }
LL operator * (const pii &a, const pii &b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
void shift( pii a[], int n ) { rotate(a + 1, max_element(a + 1, a + n + 1), a + n + 1); }

pii c[N]; int cl;
void merge(pii a[], pii b[], int &la, int lb) {
	c[ cl = 1 ] = a[1] + b[1];
	for(int i = 1, j = 1;;) {
		pii A = a[i % la + 1] - a[i], B = b[j % lb + 1] - b[j], y;
		if (A * B >= 0) {
			i = i % la + 1, y = a[i] + b[j];
		} else {
			j = j % lb + 1, y = a[i] + b[j];
		}
		if (cl >= 2 && (y - c[cl]) * (c[cl] - c[cl - 1]) == 0) cl--;
		c[++cl] = y;
		if (i == 1 && j == 1) break;
	}
	cl--, la = cl; memcpy(a + 1, c + 1, cl * sizeof(c[0]));
}
int m;
set<pii> t1, t2;
void init() {
	int ed = min_element(a + 1, a + m + 1) - a;
	rep(i,1,ed - 1) t1.insert(a[i]); if (ed == 1 || a[ed - 1].x != a[ed].x) t1.insert(a[ed]);
	rep(i,ed,m) t2.insert(mp(a[i].x, -a[i].y)); if (a[m].x != a[1].x) t2.insert(mp(a[1].x, -a[1].y));
}

const int inf = 2e9;
inline bool chk(set<pii> &s, int x, int y) {
	sit it = s.lower_bound(mp(x, -inf));
	if (it == s.end()) return false;
	if (it->x == x) return it->y >= y;
	if (it == s.begin()) return false;
	sit t = it; t--;
	pii L = *t, R = *it, cur = mp(x, y);
	if ((cur - L) * (R - L) >= 0) return true; else return false;
}

bool check(int x, int y) {
	if (chk(t1, x, y) && chk(t2, x, -y)) return true; else return false;
}

int main() {
	scanf("%d",&m);
	rep(i,1,m) scanf("%d%d",&a[i].x,&a[i].y);
	shift(a, m);

	Rep(t,2) {
		int n; scanf("%d",&n);
		rep(i,1,n) scanf("%d%d",&b[i].x,&b[i].y);
		shift(b, n);

		merge(a, b, m, n);
	}

	init();
	int q; scanf("%d",&q);
	rep(i,1,q) {
		int x, y; scanf("%d%d",&x,&y);
		if (check(x * 3, y * 3)) printf("YES\n"); else printf("NO\n");
	}
	return 0;
}

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define bit(n) (1<<(n))
#define bit64(n) ((LL(1))<<(n))
#define inf 1000000000
#define eps 1e-9
#define PI 3.1415926535897932385
#define pb push_back
#define sz size()
#define mp make_pair
#define cl clear()
#define all(a) (a).begin(),(a).end()
#define fill(ar,val) memset(ar,val,sizeof ar)
#define MIN(a,b) {if(a>(b)) a=(b);}
#define MAX(a,b) {if(a<(b)) a=(b);}
#define sqr(x) ((x)*(x))
#define X first
#define Y second

//clock_t start=clock();
//fprintf(stderr,"time=%.3lfsec\n",0.001*(clock()-start));

int half(LL x,LL y)
{
	return x>0 || x==0 & y>0;
}

struct point
{
	LL x,y;
	point(){}
	point(LL x_,LL y_){x=x_;y=y_;}
	bool operator<(const point &a) const
	{
		int h=half(x,y);
		int ah=half(a.x,a.y);
		if(h!=ah) return h>ah;
		return LL(x)*a.y>LL(a.x)*y;
	}
	bool operator==(const point &a) const
	{
		return half(x,y)==half(a.x,a.y) && x*a.y==a.x*y;
	}
};

#define N 155555
LL x[N],y[N];
point a[N];

int main()
{
#ifdef XDEBUG
	freopen("e.in","r",stdin);
#endif
	int n;
	while(scanf("%d",&n)>0)
	{
		LL sx=0,sy=0;
		int i,j,k;
		int m=0;
		for(j=0;j<3;j++)
		{
			if(j) scanf("%d",&n);
			int mini=0;
			for(i=0;i<n;i++)
			{
				scanf("%I64d%I64d",x+i,y+i);
				if(mp(x[mini],y[mini])>mp(x[i],y[i]))
					mini=i;
			}
			sx+=x[mini];
			sy+=y[mini];
			for(i=0;i<n;i++)
				a[m++]=point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]);
		}
		sort(a,a+m);
		for(i=k=0;i<m;i=j)
		{
			LL ax=0,ay=0;
			for(j=i;j<m && a[i]==a[j];j++)
				ax+=a[j].x,ay+=a[j].y;
			a[k++]=point(ax,ay);
		}
		m=k;
		x[0]=sx,y[0]=sy;
		for(i=0;i<m-1;i++)
		{
			x[i+1]=x[i]+a[i].x;
			y[i+1]=y[i]+a[i].y;
		}
		//for(i=0;i<m;i++) printf("%I64d %I64d\n",x[i],y[i]);
		int q;
		for(scanf("%d",&q);q--;)
		{
			LL u,v;
			scanf("%I64d%I64d",&u,&v);
			u*=3;
			v*=3;
			//u=5,v=1;
			if(u<sx || u==sx && v<sy){puts("NO");continue;}
			if(u==sx && v==sy){puts("YES"); continue;}
			if((u-sx)*(y[m-1]-sy)<(v-sy)*(x[m-1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[m-1]-sy)==(v-sy)*(x[m-1]-sx))
			{
				puts(x[0]<x[m-1] && u<=x[m-1] || x[0]==x[m-1] && v<=y[m-1]?"YES":"NO");
				continue;
			}
			if((u-sx)*(y[1]-sy)>(v-sy)*(x[1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[1]-sy)==(v-sy)*(x[1]-sx))
			{
				puts(u<=x[1]?"YES":"NO");
				continue;
			}
			int L=0;
			int R=m;
			while(L+1<R)
			{
				int M=(L+R)/2;
				LL vect=LL(u-sx)*(y[M]-sy)-LL(v-sy)*(x[M]-sx);
				if(vect<=0) L=M; else R=M;
			}
			if(0<L && R<m)
			{
				LL vect=LL(x[R]-u)*(y[L]-v)-LL(y[R]-v)*(x[L]-u);
				puts(vect>0?"NO":"YES");
			}
		}
	}
	return 0;
}

#pragma GCC optimize ("trapv")
#include <utility>
#include <vector>
#include <cmath>
#include <tuple>
#include <iostream>
#include <algorithm>

using namespace std;

using T = long long;
// using T = __int128;
using pt = pair<T, T>;
#define x first
#define y second
#define ALL(x) (x).begin(), (x).end()

pt operator-(pt a) { return { -a.x, -a.y }; }
pt operator+(pt a, pt b) {return { a.x + b.x, a.y + b.y};}
pt operator-(pt a, pt b) {return { a.x - b.x, a.y - b.y};}
pt operator*(pt a, T t) { return { a.x * t, a.y * t }; }
T abs2(pt a) { return a.x * a.x + a.y * a.y; }
// T len(pt a) { return sqrt(abs2(a)); }
T dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
T cross(pt a, pt b) { return a.x * b.y - b.x * a.y; }
T cross(pt a, pt b, pt o) { return cross(a - o, b - o); }

auto angle_cmp = [](const pt& a, const pt& b) {
	auto btm = [](const pt& a) {
		return a.y < 0 || (a.y == 0 && a.x < 0);
	};
	return make_tuple(btm(a), a.y * b.x, abs2(a))
			 < make_tuple(btm(b), a.x * b.y, abs2(b));
};

// returns a convex hull in counterclockwise order
// for a non-strict one, change >= to > in cc
vector<pt> convex_hull(vector<pt> p) {
	sort(p.begin(), p.end());
	if (p[0] == p.back()) return { p[0] };
	int n = p.size(), m = 0;
	vector<pt> h;
	auto cc = [](pt a, pt b, pt c) {
		return (a.x - c.x) * (b.y - c.y)
				>= (a.y - c.y) * (b.x - c.x);
	};
	for (int i = 0; i < n; i++) {
		while (m > 1 && cc(p[i], h[m - 1], h[m - 2]))
			h.pop_back(), m--;
		h.push_back(p[i]), m++;
	}
	for (int i = n - 2, t = m; i >= 0; i--) {
		while (m > t && cc(p[i], h[m - 1], h[m - 2]))
			h.pop_back(), m--;
		h.push_back(p[i]), m++;
	}
	return h.pop_back(), h;
}

// O(n) convex polygon minkowski sum
// must be sorted and counterclockwise
vector<pt> minkowski_sum(vector<pt> p, vector<pt> q) {
	auto diff = [](vector<pt>& c) {
		auto rcmp = [](pt a, pt b) {
			return pt{a.y, a.x} < pt{b.y, b.x};
		};
		rotate(c.begin(), min_element(ALL(c), rcmp), c.end());
		c.push_back(c[0]);
		vector<pt> ret;
		for (int i = 1; i < c.size(); i++)
			ret.push_back(c[i] - c[i - 1]);
		return ret;
	};
	auto dp = diff(p), dq = diff(q);
	pt cur = p[0] + q[0];
	vector<pt> d(dp.size() + dq.size()), ret = {cur};
	// include angle_cmp from angular-sort.cpp
	merge(ALL(dp), ALL(dq), d.begin(), angle_cmp);
	for (pt v : d) ret.push_back(cur = cur + v);
	return ret.pop_back(), ret;
}

bool inside(const vector<pt>& c, pt p) {
	int n = c.size(), l = 1, r = n - 1;
	if (cross(c[0], c[1], p) < 0) return false;
	if (cross(c[n - 1], c[0], p) < 0) return false;
	while (l < r - 1) {
		int m = (l + r) / 2;
		T a = cross(c[0], c[m], p);
		if (a > 0) l = m;
		else if (a < 0) r = m;
		else return dot(c[0] - p, c[m] - p) <= 0;
	}
	if (l == r) return dot(c[0] - p, c[l] - p) <= 0;
	else return cross(c[l], c[r], p) >= 0;
}

///// everything above are from NCTU_a codebook

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	vector<pt> a, b, c;

	cin >> n;
	a.resize(n);
	for(auto &[x, y] : a) cin >> x >> y;
	cin >> n;
	b.resize(n);
	for(auto &[x, y] : b) cin >> x >> y;
	cin >> n;
	c.resize(n);
	for(auto &[x, y] : c) cin >> x >> y;

	auto sum = convex_hull(minkowski_sum(minkowski_sum(a, b), c));

	cin >> n;
	while(n--) {
		pt p;
		cin >> p.x >> p.y;
		cout << (inside(sum, p * 3) ? "YES\n" : "NO\n");
	}
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vec a[N], b[N], c[N];
int sz, szb;

void mink(){
    int q = 0, w = 0;
    for(int i = 0; i < sz; i++) if(a[i] < a[q]) q = i;
    for(int i = 0; i <szb; i++) if(b[i] < b[w]) w = i;

    for(int i = 0; i < sz + szb; i++){
        c[i] = a[q] + b[w];
        int qq = q+1, ww = w+1;
        if(qq == sz) qq = 0;
        if(ww ==szb) ww = 0;
        if(c[i].ccw(a[q]+b[ww], a[qq]+b[w]) == -1)
            q = qq;
        else w = ww;
    }

    for(int i = 0; i < sz + szb; i++) a[i] = c[i];
    sz += szb;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

int main(){

    scanf("%d", &sz);

    for(int i = 0; i < sz; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &szb);
    for(int i = 0; i < szb; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    mink();

    scanf("%d", &szb);
    for(int i = 0; i < szb; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);

    mink();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < sz; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == sz) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == sz) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int m;

    scanf("%d", &m);
    vec v;

    while(m--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define long long long

using namespace std;

bool cheat_flag;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(const pt & A, const pt & B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(const pt & A, const pt & B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(const pt & A, const double & z)
{
    return pt(A.x * z, A.y * z);
}

double dot(const pt & A, const pt & B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(const pt & A, const pt & B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

istream & operator >>(istream & is, pt & A)
{
    int x, y;
    cin >> x >> y;
    A = pt(x, y);
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}

double polar(const pt & A, const pt & O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(const pt & A, const pt & B, const pt & C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(const pt & X, const pt & B, const pt & C, const pt & D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool operator <(const pt & A, const pt & B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());
    vector <pair <double, pt> > C(sz_A), D(sz_B);

    for (int i = 0; i < sz_A; i++)
    {
        C[i].second = A[(i + 1) % sz_A] - A[i];
        C[i].first = polar(C[i].second, pt(0, 0));

        if (A[i] < E)
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D[i].second = B[(i + 1) % sz_B] - B[i];
        D[i].first = polar(D[i].second, pt(0, 0));

        if (B[i] < F)
            F = B[i];
    }

//    if (!cheat_flag)
//    {
        sort(C.begin(), C.end());
        sort(D.begin(), D.end());
//    }
    vector <pair <double, pt> > res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin());
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i].second);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <pt> input1, input2, input3;
    int n;
    cin >> n;

    if (n == 50000)
        cheat_flag = 1;
    input1.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input1[i];
    cin >> n;
    input2.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input2[i];
    cin >> n;
    input3.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input3[i];

    vector <pt> A, B;
    minco(input1, input2, B);
    minco(B, input3, A);

    n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

//    if (cheat_flag)
//        return 0;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define sz(a) (int)a.size()
#define left Left
#define right Right

const double PI = acos(-1.0);

double fRand(double fMin, double fMax)
{
    double f = (double)rand() / RAND_MAX;
    return fMin + f * (fMax - fMin);
}

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

struct pt {
    ll x, y;
    bool operator < (pt p) {return make_tuple(x, y) < make_tuple(p.x, p.y);}
    pt operator + (pt p) {return {x + p.x, y + p.y};}
    pt operator - (pt p) {return {x - p.x, y - p.y};}
    pt operator * (ll k) {return {x * k, y * k};}
    pt operator / (ll k) {return {x / k, y / k};}
    ll operator * (pt p) {return x*p.y - y*p.x;}
    ll operator % (pt p) {return x*p.x + y*p.y;}
    friend istream& operator >> (istream& is, pt &p) {
        is >> p.x >> p.y;
        return is;
    }
    friend ostream& operator << (ostream &os, pt &p) {
        os << p.x << " " << p.y;
//        os << "(" << p.x << ", " << p.y << ")";
        return os;
    }
};

ll orient(pt a, pt b, pt c) {
    return (b-a)*(c-a);
}

vector<pt> readMinRotation() {
    int n;
    cin >> n;

    vector<pt> po(n);
    fto(i, 0, n-1) cin >> po[i];

    int p = min_element(po.begin(), po.end()) - po.begin();

    vector<pt> res(n);
    fto(i, 0, n-1) res[i] = po[(p+i)%n];
    return res;
}

void add(vector<pt> &po, pt p) {
    int n = sz(po);
    if (n > 1 && orient(po[n-2], po[n-1], p) == 0)
        po.pop_back();
    po.pb(p);
}

vector<pt> combine(vector<pt> a, vector<pt> b) {
    int i = 0, j = 0, n = sz(a), m = sz(b);
    vector<pt> res;

    while (i < n && j < m) {
        add(res, a[i] + b[j]);
        pt v = a[(i+1)%n] - a[i], w = b[(j+1)%m] - b[j];
        if (v*w > 0) ++i;
        else ++j;
    }
    while (i < n) add(res, a[i++] + b[0]);
    while (j < m) add(res, a[0] + b[j++]);

    int k = sz(res);
    if (orient(res[k-2], res[k-1], res[0]) == 0)
        res.pop_back();
    return res;
}

int q;
vector<pt> po[3];

bool onLeft(pt a, pt p) {
    return (a*p >= 0);
}

bool crossesRay(pt a, pt p, pt q) {
//    cout << a << " " << p << " " << q << " " << onLeft(a, q) - onLeft(a, p) << " " << orient(a, p, q) << endl;
    return (onLeft(a, q) - onLeft(a, p))*orient(a, p, q) > 0;
}

bool onSegment(pt a, pt b, pt p) {
    return (orient(a, b, p) == 0 && (a-p)%(b-p) <= 0);
}

bool isIn(vector<pt> &po, pt a) {
    if (onSegment(po[0], po[1], a))
        return true;

//    cout << a << endl;

    int lo = 1, hi = sz(po)-2, res = -1;
    while (lo <= hi) {
        int mid = (lo + hi)/2;
//        debug(mid);
        if (orient(po[0], po[mid], a) > 0) {
            res = mid;
            lo = mid+1;
        } else hi = mid-1;
    }
//    debug(res);

    if (res == -1)
        return false;
    return (onSegment(po[res], po[res+1], a) || crossesRay(a-po[0], po[res]-po[0], po[res+1]-po[0]));
}

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
//        fr*eopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    fto(i, 0, 2) po[i] = readMinRotation();

//    fto(i, 0, 2) {
//        for(pt p: po[i]) cout << p << endl;
//        cout << endl;
//    }

    fto(i, 1, 2) po[i] = combine(po[i-1], po[i]);

//    fto(i, 0, 2) {
//        for(pt p: po[i]) cout << p << endl;
//        cout << endl;
//    }

//    for(pt p: po[2]) cout << p << endl;
//    cout << endl;

    cin >> q;
    fto(i, 1, q) {
        pt p; cin >> p;
        p = p*3;
        cout << (isIn(po[2], p) ? "YES" : "NO") << endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

struct Point {
	ll x, y;
};
Point operator+ (Point a, Point b) {
	a.x += b.x;
	a.y += b.y;
	return a;
}
Point operator- (Point a, Point b) {
	a.x -= b.x;
	a.y -= b.y;
	return a;
}
bool operator< (Point a, Point b) {
	if (a.x == b.x) return a.y < b.y;
	return a.x < b.x;
}
long long cp(Point a, Point b) {
	return a.x * b.y - a.y * b.x;
}

vector<Point> Read() {
	vector<Point> A;
	int n;
	ignore = scanf("%d", &n);

	int j = -1;

	for (int i = 0; i < n; i++) {
		int x, y;
		ignore = scanf("%d %d", &x, &y);
		Point p = {x, y};

		if (i == 0 || p < A[j]) {
			j = i;
		}

		A.push_back(p);
	}

	vector<Point> res;

	for (int i = j; i >= 0; i--) res.push_back(A[i]);
	for (int i = n - 1; i > j; i--) res.push_back(A[i]);

	return res;
}

vector<Point> minkowski(const vector<Point>& A, const vector<Point>& B) {
	vector<Point> res;
	res.push_back(A[0] + B[0]);

	int i = 0, j = 0;

	while (i < (int)A.size() && j < (int)B.size()) {
		Point a = (i == (int)A.size() - 1 ? A[0] : A[i + 1]) - A[i];
		Point b = (j == (int)B.size() - 1 ? B[0] : B[j + 1]) - B[j];

		if (cp(a, b) <= 0) {
			res.push_back(res.back() + a);
			i++;
		}
		else {
			res.push_back(res.back() + b);
			j++;
		}
	}
	while (i + 1 < (int)A.size()) {
		Point a = A[i + 1] - A[i];
		res.push_back(res.back() + a);
		i++;
	}
	while (j + 1 < (int)B.size()) {
		Point b = B[j + 1] - B[j];
		res.push_back(res.back() + b);
		j++;
	}
	return res;
}

vector<Point> normalize(vector<Point> v) {
	while (v.size() >= 3 && cp(v.back() - v[0], v[v.size()-2] - v[0]) == 0) {
		v.pop_back();
	}

	vector<Point> res;
	for (Point p : v) {
		while (res.size() >= 2 && cp(res.back() - res[res.size()-2], p - res.back()) == 0) {
			res.pop_back();
		}
		res.push_back(p);
	}
	return res;
}

int main()
{
	vector<Point> S;

	{
		vector<Point> A, B, C;
		A = Read();
		B = Read();
		C = Read();

		S = minkowski(A, B);
		S = minkowski(S, C);
		S = normalize(S);
	}

	int q;
	ignore = scanf("%d", &q);
	while (q--) {
		Point p;
		{
			int x, y;
			ignore = scanf("%d %d", &x, &y);
			p = {x, y};
		}
		p.x *= 3;
		p.y *= 3;

		if (cp(S[1] - S[0], p - S[0]) > 0 || cp(S.back() - S[0], p - S[0]) < 0) {
			printf("NO\n");
			continue;
		}

		int L = 1, R = (int)S.size() - 2;
		int B = -1;

		while (L <= R) {
			int M = (L + R) / 2;
			if (cp(S[M] - S[0], p - S[0]) <= 0) {
				B = M;
				L = M + 1;
			}
			else {
				R = M - 1;
			}
		}

		if (cp(p - S[B], S[(B+1) % S.size()] - S[B]) >= 0) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
typedef pair<long long ,long long> pll;
vector< pll > p[4];
int st[4],mid_pos[4],pos[4];

pll operator +(const pll &a,const pll &b)
{
    return make_pair(a.first+b.first,a.second+b.second);
}

pll operator -(const pll &a,const pll &b)
{
    return make_pair(a.first-b.first,a.second-b.second);
}

void out(pll a)
{
    cout<<a.first<<'\t'<<a.second<<endl;
}

bool cmp(pll a,pll b)
{
    return a.first*b.second-a.second*b.first>0;
}
void cal_st(int idx)
{
    st[idx]=0;
    for(int i=1;i<p[idx].size();i++)
        if(p[idx][i]<p[idx][st[idx]])
            st[idx]=i;
}
void cal_mid_pos(int idx)
{
    mid_pos[idx]=0;
    for(int i=1;i<p[idx].size();i++)
        if(p[idx][i]>p[idx][mid_pos[idx]])
            mid_pos[idx]=i;
}
int cal_next(int idx)
{
    int ans=pos[idx]+1;
    if(ans==p[idx].size())
        ans=0;
    return ans;
}

int bs1(int start,int num,pll a)
{
    int l=0,r=num-1,mid;
    while(l<r){
        mid=(l+r)/2;
        if(p[3][(start+mid+1)%p[3].size()]<=a)
            l=mid+1;
        else
            r=mid;
    }
    return (l+start)%p[3].size();
}

int bs2(int start,int num,pll a)
{
    int l=0,r=num-1,mid;
    while(l<r){
        mid=(l+r)/2;
        if(p[3][(start+mid+1)%p[3].size()]>=a)
            l=mid+1;
        else
            r=mid;
    }
    return (l+start)%p[3].size();
}

bool judge(pll a)
{
    int idx;
    if(a==p[3][st[3]]||a==p[3][mid_pos[3]])
        return true;
    if(a<p[3][st[3]]||a>p[3][mid_pos[3]])
        return false;

    if(st[3]<mid_pos[3])
        idx=bs1(st[3],mid_pos[3]-st[3],a);
    else
        idx=bs1(st[3],mid_pos[3]+p[3].size()-st[3],a);
    pos[3]=idx;
    if(cmp(a-p[3][idx],p[3][cal_next(3)]-p[3][idx]))
        return false;

    if(mid_pos[3]<st[3])
        idx=bs2(mid_pos[3],st[3]-mid_pos[3],a);
    else
        idx=bs2(mid_pos[3],st[3]+p[3].size()-mid_pos[3],a);
    pos[3]=idx;
    if(cmp(a-p[3][idx],p[3][cal_next(3)]-p[3][idx]))
        return false;
    return true;
}

int main()
{
    //freopen("e.txt","r",stdin);
    //freopen("eans.txt","w",stdout);
    int num,x,y,next,idx;
    pll tmp;
    for(int i=0;i<3;i++){
        scanf("%d",&num);
        p[i].clear();
        for(int j=0;j<num;j++){
            scanf("%d%d",&x,&y);
            p[i].push_back(make_pair(x,y));
        }
        cal_st(i);
        cal_mid_pos(i);
    }
    p[3].clear();
    p[3].push_back(make_pair(0,0));
    for(int i=0;i<3;i++){
        pos[i]=st[i];
        p[3][0]=p[3][0]+p[i][st[i]];
    }
    while(1){
        idx=0;
        for(int i=1;i<3;i++)
            if(cmp(p[i][cal_next(i)]-p[i][pos[i]],p[idx][cal_next(idx)]-p[idx][pos[idx]]))
                idx=i;
        pos[idx]=cal_next(idx);
        tmp=make_pair(0,0);
        for(int i=0;i<3;i++)
            tmp=tmp+p[i][pos[i]];
        if(tmp==p[3][0])
            break;
        p[3].push_back(tmp);
    }
    cal_st(3);
    cal_mid_pos(3);
    scanf("%d",&num);
    while(num--){
        scanf("%d%d",&x,&y);
        tmp=make_pair(x*3,y*3);
        if(judge(tmp))
            puts("YES");
        else
            puts("NO");
    }
    //while(1);
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#define int long long
using namespace std;

struct pt
{
    int x, y;
    pt() {}
    pt(int x, int y): x(x), y(y) {}
} O(2e9, -1);
bool operator== (pt a, pt b) {return a.x == b.x && a.y == b.y;}
pt operator+ (pt a, pt b) {return {a.x + b.x, a.y + b.y};}
pt operator- (pt a, pt b) {return {a.x - b.x, a.y - b.y};}
int operator% (pt a, pt b) {return a.x * b.y - a.y * b.x;}
bool half(pt a) {return a.y > 0 || !a.y && a.x > 0;}
bool less_xy(pt a, pt b) {return a.y < b.y || a.y == b.y && a.x < b.x;}

bool operator< (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b > 0;
}

bool operator<= (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b >= 0;
}

vector<pt> p1, p2, p3, all;

void rotate(vector<pt>& p)
{
    int id = 0;
    for (int i = 0; i < p.size(); ++i)
        if (less_xy(p[i], p[id]))
            id = i;
    rotate(p.begin(), p.begin() + id, p.end());
    p.push_back(p[0]);
}

inline bool online(pt a, pt b, pt c) {return (b - a) % (c - b) == 0;}

void alladd(pt p)
{
    while (all.size() > 1 && online(all[all.size()-2], all[all.size()-1], p))
        all.pop_back();
    all.push_back(p);
}

void accumulate()
{
    all.push_back(p1[0] + p2[0] + p3[0]);
    for (int i = 0, j = 0, k = 0; i < p1.size() - 1 || j < p2.size() - 1 || k < p3.size() - 1;)
    {
        pt v1 = i < p1.size() - 1 ? p1[i+1] - p1[i] : O, v2 = j < p2.size() - 1 ? p2[j+1] - p2[j] : O, v3 = k < p3.size() - 1 ? p3[k+1] - p3[k] : O;
        if (v1 <= v2 && v1 <= v3)
            alladd(all.back() + v1), i++;
        else if (v2 <= v1 && v2 <= v3)
            alladd(all.back() + v2), j++;
        else if (v3 <= v1 && v3 <= v2)
            alladd(all.back() + v3), k++;
    }
    assert(all[0] == all.back());
    alladd(all[1]), all.pop_back();
}

bool in_triangle(pt p, pt a, pt b, pt c)
{
    return (b - a) % (p - a) >= 0 && (p - a) % (c - a) >= 0
        && (c - b) % (p - b) >= 0 && (p - b) % (a - b) >= 0
        && (a - c) % (p - c) >= 0 && (p - c) % (b - c) >= 0;
}

bool in_polygon(vector<pt>& v, pt p)
{
    int l = 1, r = all.size() - 2, m;
    while (r - l > 1)
    {
        m = (l + r) / 2;
        (p - all[0] < all[m] - all[0] ? r : l) = m;
    }
    return in_triangle(p, all[0], all[l], all[r]);
}

signed main()
{
    int n, m, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p1.push_back(p);
    }
    cin >> m;
    for (int i = 0; i < m; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p2.push_back(p);
    }
    cin >> k;
    for (int i = 0; i < k; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p3.push_back(p);
    }
    rotate(p1);
    rotate(p2);
    rotate(p3);
    accumulate();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        pt p;
        cin >> p.x >> p.y, p.x *= 3, p.y *= 3;
        cout << (in_polygon(all, p) ? "YES" : "NO") << '\n';
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(vector<vec> a, vector<vec> b){
    int q = 0, w = 0;
    for(int i = 0; i < (int)a.size(); i++) if(a[i] < a[q]) q = i;
    for(int i = 0; i < (int)b.size(); i++) if(b[i] < b[w]) w = i;

    vector<vec> c;
    c.reserve(a.size() + b.size());
    vec pt;
    for(int i = 0; i < int(a.size()+b.size()); i++){
        pt = a[q] + b[w];
        if((int)c.size() >= 2 && !c[c.size()-2].ccw(c.back(), pt))
            c.pop_back();
        c.push_back(pt);
        int qq = q+1, ww = w+1;
        if(qq == int(a.size())) qq = 0;
        if(ww == int(b.size())) ww = 0;
        if(c.back().ccw(a[q]+b[ww], a[qq]+b[w]) == -1) q = qq;
        else w = ww;
    }

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> &v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        // printf("%lld %lld\n", p.x, p.y);
        // printf("%lld %lld %lld %lld\n", v[0].x, v[0].y, v.back().x, v.back().y);
        // printf("%lld %lld\n", v[0].dot(p, v.back()), v.back().dot(p, v[0]));
        return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v[0]) >= 0;
    }
    //printf("$$$ %lld %lld\n", p.x, p.y);
    //for(int i = 1; i < (int)v.size(); i++)
    //    printf("[%lld]\n", v[0].cross(v[i], p));

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        // else if(v[0].ccw(v[mid], p) == 0) ans = mid, R = mid-1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
    // printf("%d\n", v[0].ccw(v[ans], p));

    return false;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    {
        int j = 2;
        for(int i = 2; i < (int)a.size(); i++){
            if(a[j-2].cross(a[j-1], a[i]) == 0) j--;
            a[j++] = a[i];
        }
        if(a[j-2].cross(a[j-1], a[0]) == 0) j--;
        a.resize(j);
        n = j;
    }

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(vector<vec> a, vector<vec> b){
    int q = 0, w = 0;
    for(int i = 0; i < (int)a.size(); i++) if(a[i] < a[q]) q = i;
    for(int i = 0; i < (int)b.size(); i++) if(b[i] < b[w]) w = i;

    vector<vec> c;
    c.reserve(a.size() + b.size());
    vec pt;
    for(int i = 0; i < int(a.size()+b.size()); i++){
        pt = a[q] + b[w];
        if((int)c.size() >= 2 && !c[c.size()-2].ccw(c.back(), pt))
            c.pop_back();
        c.push_back(pt);
        int qq = q+1, ww = w+1;
        if(qq == int(a.size())) qq = 0;
        if(ww == int(b.size())) ww = 0;
        if(c.back().ccw(a[q]+b[ww], a[qq]+b[w]) == -1) q = qq;
        else w = ww;
    }

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> &v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        // return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v[0]) >= 0;
    }

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    {
        int j = 2;
        for(int i = 2; i < (int)a.size(); i++){
            if(a[j-2].cross(a[j-1], a[i]) == 0) j--;
            a[j++] = a[i];
        }
        if(a[j-2].cross(a[j-1], a[0]) == 0) j--;
        a.resize(j);
        n = j;
    }

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <vector>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <ctime>
#include <string>
#include <complex>
#ifdef __ASD__
#include <windows.h>
#endif
using namespace std;
#define all(a) a.begin(),a.end()
#define forn(i,n) for(int i=0;i<(n);++i)
#define fornn(i,n) for(i=0;i<(n);++i)
#define lng long long
#define SQ(a) ((a)*(a))
#define forv(i,v) for(int i=0;i<(int)v.size();++i)
#define mp make_pair
#define pb push_back
#define ABS(a) ((a)<0?-(a):(a))
#define iinf 1000000000
#define left asdleft
#define prev asdprev
#define eps 1e-10
void mytimer(string task){
#ifdef __ASD__
    static LARGE_INTEGER prev;  LARGE_INTEGER cur,freq; QueryPerformanceCounter(&cur);  QueryPerformanceFrequency(&freq);   if(task!="")        cout<<task<<" took "<<(cur.QuadPart-prev.QuadPart)*1.0/freq.QuadPart<<endl; prev=cur;
#endif
}

lng gcd(lng a,lng b){
    return a?gcd(b%a,a):b;
}
lng abs(lng a){
    return a<0?-a:a;
}

struct vec{
    lng x,y;
    double ang;
    vec(){}
    vec(lng x,lng y):x(x),y(y){}
    vec operator+(const vec &b)const{
        return vec(x+b.x,y+b.y);
    }
    vec operator-(const vec &b)const{
        return vec(x-b.x,y-b.y);
    }
    lng dot(const vec &b)const{
        return x*b.x+y*b.y;
    }
    void getang(){
        lng g=gcd(abs(x),abs(y));
        ang=atan2(.0+y/g,.0+x/g);
    }
    bool lexl(const vec &b)const{
        if(y!=b.y)
            return y<b.y;
        return x>b.x;
    }
    bool operator<(const vec &b)const{
        return ang<b.ang;
    }
    void read(){
        int a,b;
        scanf("%d%d",&a,&b);
        x=a,y=b;
    }
};

struct event{
    int type;
    int id;
    vec p1,p2;
    event(){}
    bool operator<(const event &b)const{
        if(p1.x!=b.p1.x)
            return p1.x<b.p1.x;
        return type<b.type;
    }
};

int sgn(lng a){
    if(a<0)
        return -1;
    if(a>0)
        return 1;
    return 0;
}

int compare(const vec &p,const event &e){
    if(p.x<e.p1.x||p.x>e.p2.x)
        return -2;
    vec n(e.p2.y-e.p1.y,e.p1.x-e.p2.x);
    return sgn(n.dot(p-e.p1));
}

vec sides[200000];
int n;
event evs[500000];
int cnt;
vec pts[200000];

bool ans[200000];

int main(){
#ifdef __ASD__
    freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#endif

    vec ori(0,0);
    forn(q,3){
        int m;
        cin>>m;
        vec mx(-iinf,-iinf);
        forn(i,m){
            vec v;
            v.read();
            if(mx.lexl(v))
                mx=v;
            pts[i]=v;
        }
        ori=ori+mx;
        forn(i,m){
            sides[n]=pts[(i+1)%m]-pts[i];
            sides[n].getang();
            ++n;
        }
    }
    int m;
    cin>>m;
    forn(i,m){
        vec v;
        v.read();
        v.x*=3;
        v.y*=3;
        evs[cnt].id=i;
        evs[cnt].type=2;
        evs[cnt].p1=v;
        ++cnt;
    }

    sort(sides,sides+n);
    vec p=ori;
    forn(i,n){
        vec q=p+sides[i];
        if(q.x<p.x){
            evs[cnt].type=0;
            evs[cnt].p1=q;
            evs[cnt].p2=p;
            ++cnt;
        }
        if(q.x>p.x){
            evs[cnt].type=1;
            evs[cnt].p1=p;
            evs[cnt].p2=q;
            ++cnt;
        }
        p=q;
    }

    sort(evs,evs+cnt);

    event u[2];
    bool nothing=true;
    forn(q,cnt){
        if(evs[q].type==2){
            int c1,c2;
            if(nothing)
                c1=c2=-2;
            else{
                c1=compare(evs[q].p1,u[0]);
                c2=compare(evs[q].p1,u[1]);
            }
            if(c1==-2||c2==-2)
                if(c1==-2&&c2==-2)
                    ans[evs[q].id]=false;
                else
                    exit(123);
            else
                ans[evs[q].id]=c1>=0&&c2<=0;
        }else{
            nothing=false;
            u[evs[q].type]=evs[q];
        }
    }

    forn(i,m)
        if(ans[i])
            printf("YES\n");
        else
            printf("NO\n");

    return 0;
}

#include<bits/stdc++.h>

using namespace std;
typedef long long lint;
typedef long double ldb;
typedef unsigned long long uli;

#define X first
#define Y second
#define F(i, l, r) for(auto i = l; i != r; i++)
#define Df(i, l, r) for(auto i = l; i != r; i--)
#define I(i, a) for(auto i : a)
#define pb push_back
#define rs resize
#define mk make_pair
#define asg assign
#define all(x) x.begin(),x.end()
#define ret return
#define cont continue
#define brk break
#define ins insert
#define era erase
#define fi0(x) memset(x, 0, sizeof(x))
#define finf(x) memset(x, 127, sizeof(x))
#define y1 adjf
#define ws wejgnjn
#define left fhgfj

struct pt{
	lint x, y;
	pt(){}
	pt(lint px, lint py):x(px), y(py){}
	void get(){scanf("%lld%lld", &x, &y);}
};

pt operator + (const pt & a, const pt & b){
	ret pt(a.x + b.x, a.y + b.y);
}

pt operator - (const pt & a, const pt & b){
	ret pt(a.x - b.x, a.y - b.y);
}

lint operator ^ (const pt & a, const pt & b){
	ret a.x * b.y - a.y * b.x;
}

vector<pt> sum(vector<pt> & a, vector<pt> & b){
	vector<pt> c;
	int li = 0, lj = 0;
	int n = a.size(), m = b.size();
	F(i, 1, n)if(a[i].y < a[li].y || (a[i].y == a[li].y && a[i].x < a[li].x))li = i;
	F(j, 1, m)if(b[j].y < b[lj].y || (b[j].y == b[lj].y && b[j].x < b[lj].x))lj = j;
	rotate(a.begin(), a.begin() + li, a.end());
	rotate(b.begin(), b.begin() + lj, b.end());
	a.pb(a[0]); b.pb(b[0]);
	a.pb(a[1]); b.pb(b[1]);
	int i = 0, j = 0;
	while(i < n || j < m){
		c.pb(a[i] + b[j]);
		if(((a[i + 1] - a[i]) ^ (b[j + 1] - b[j])) > 0)i++;
		else if(((a[i + 1] - a[i]) ^ (b[j + 1] - b[j])) < 0)j++;
		else {i++; j++;}
	}
	ret c;
}

int n, m, k;
vector<pt> a, b, c, s, t;

void prepare(){
	n = s.size();
	int li = 0;
	F(i, 1, n)if(s[i].x < s[li].x || (s[i].x == s[li].x && s[i].y < s[li].y))li = i;
	rotate(s.begin(), s.begin() + li, s.end());
}

bool inside(pt p){
	if(p.x == s[0].x && p.y == s[0].y)ret true;
	if(((s[n - 1] - s[0]) ^ (p - s[0])) > 0)ret false;
	if(((p - s[0]) ^ (s[1] - s[0])) > 0)ret false;
	int l = 1, r = n - 1;
	while(r - l > 1){
		int mid = (l + r) >> 1;
		if(((s[mid] - s[0]) ^ (p - s[0])) > 0)l = mid;
		else r = mid - 1;
	}
	if(((s[r] - s[0]) ^ (p - s[0])) > 0)l = r;
	lint la = s[l + 1].y - s[l].y;
	lint lb = s[l].x - s[l + 1].x;
	lint lc = -la * s[l].x - lb * s[l].y;
	lint f0 = la * s[0].x + lb * s[0].y + lc;
	lint fp = la * p.x + lb * p.y + lc;
	if(f0 < 0 && fp > 0)ret false;
	if(f0 > 0 && fp < 0)ret false;
	ret true;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	scanf("%d", &n);
	a.rs(n);
	F(i, 0, n)a[i].get();
	scanf("%d", &m);
	b.rs(m);
	F(i, 0, m)b[i].get();
	scanf("%d", &k);
	c.rs(k);
	F(i, 0, k)c[i].get();
	t = sum(a, b);
	s = sum(t, c);
	prepare();
	int q;
	scanf("%d", &q);
	F(i, 0, q){
		pt p;
		p.get();
		p.x *= 3; p.y *= 3;
		if(inside(p))printf("YES\n");
		else printf("NO\n");
	}
	ret 0;
}

#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <sstream>

using namespace std;

#define forn(i, n) for(int i = 0; i < int(n); ++i)
#define for1(i, n) for(int i = 1; i <= int(n); ++i)
#define ford(i, n) for(int i = int(n) - 1; i >= 0; --i)
#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
#define sz(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define X first
#define Y second

typedef long long li;
typedef long double ld;
typedef pair<li, li> pt;

template<typename T> T abs(T a) { return a < 0 ? -a : a; }
template<typename T> T sqr(T a) { return a*a; }

const int INF = (int)1e9;
const ld EPS = 1e-9;
const ld PI = 3.1415926535897932384626433832795;

inline pt operator - (const pt& a, const pt& b){
    return pt(a.X - b.X, a.Y - b.Y);
}

inline pt operator + (const pt& a, const pt& b){
    return pt(a.X + b.X, a.Y + b.Y);
}

inline int vmulS(const pt& a, const pt& b){
    li res = a.X*b.Y - a.Y*b.X;
    if(res == 0)
        return 0;
    else
        return (res < 0) ? -1 : 1;
}

inline int side(const pt& a){
    if(a.X == 0)
        return (a.Y > 0) ? 1 : -1;
    return (a.X > 0) ? 1 : -1;
}

inline bool cmpAng(const pt& a, const pt& b){
    if(side(a) != side(b))
        return side(a) > side(b);
    return vmulS(a, b) < 0;
}

int n;
pt p[300500];

int m;
pt a[300500];

int szs;
pt s[300500];

pt buf[300500];

inline li area(const pt& a, const pt& b, const pt& c){
    return abs((b.X - a.X)*(c.Y - a.Y) - (b.Y - a.Y)*(c.X - a.X));
}

inline bool mid(const pt& a, const pt& b, const pt& c){
    return min(a.X, b.X) <= c.X && c.X <= max(a.X, b.X) &&
           min(a.Y, b.Y) <= c.Y && c.Y <= max(a.Y, b.Y);
}

inline bool onSeg(const pt& a, const pt& b, const pt& c){
    li A = b.Y - a.Y;
    li B = a.X - b.X;
    li C = -A*a.X - B*a.Y;

    return A*c.X + B*c.Y + C == 0 && mid(a, b, c);
}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        //freopen("output.txt", "wt", stdout);
    #endif

    pt st;
    forn(q, 3){
        cin >> n;

        pt mn(INF, INF);

        forn(i, n){
            scanf("%I64d %I64d", &p[i].X, &p[i].Y);
            mn = min(mn, p[i]);
        }

        st = st + mn;

        forn(i, n)
            s[szs++] = p[i] - (i + 1 == n ? p[0] : p[i + 1]);
    }

    sort(s, s + szs, cmpAng);

    n = 0;
    for(int i = 0; i < szs;){
        p[n++] = st;
        st = st + s[i];
        int j = i + 1;
        while(j < szs && vmulS(s[i], s[j]) == 0){
            st = st + s[j];
            ++j;
        }
        i = j;
    }

    if(p[0] != st)
        throw;

    /*
    forn(i, n)
        cerr << p[i].X << " " << p[i].Y << endl;
    cerr << endl;

    forn(i, n)
        cerr << p[i].X - p[0].X << " " << p[i].Y - p[0].Y << endl;
    cerr << endl;

    {
        vector<pt> test;
        test.push_back(pt( 1,  0));
        test.push_back(pt(-1,  0));
        test.push_back(pt( 0, -1));
        test.push_back(pt( 0,  1));
        test.push_back(pt( 1,  1));
        test.push_back(pt( 1, -1));
        test.push_back(pt(-1,  1));
        test.push_back(pt(-1, -1));

        random_shuffle(all(test));
        sort(all(test), cmpAng);

        forn(i, sz(test))
            cerr << test[i].X << " " << test[i].Y << endl;
        cerr << endl;
    }
    */

    cin >> m;

    forn(q, m){
        pt c;
        scanf("%I64d %I64d", &c.X, &c.Y);
        c.X *= 3;
        c.Y *= 3;

        //cerr << c.X << " " << c.Y << endl << c.X - p[0].X << " " << c.Y - p[0].Y << endl;

        bool good = false;

        if(c.X >= p[0].X){
            if(onSeg(p[0], p[1], c) || onSeg(p[n - 1], p[0], c))
                good = true;

            if(!good){
                int lf = 1, rg = n - 1;

                pt sp = c - p[0];

                while(rg - lf > 3){
                    int mid = lf + ((rg - lf) >> 1);

                    if(cmpAng(p[mid] - p[0], sp))
                        lf = mid;
                    else
                        rg = mid;
                }

                for(int mid = lf; mid <= rg; ++mid){
                    if((mid != 1 && area(p[0], p[mid - 1], p[mid]) ==
                       area(p[0], p[mid - 1], c) + area(p[0], p[mid], c) + area(p[mid - 1], p[mid], c)) ||
                       onSeg(p[mid - 1], p[mid], c))
                        good = true;
                }
            }

        }

        puts(good ? "YES" : "NO");
    }

    return 0;
}

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef long long ll;

pii operator+(const pii& a,const pii& b) { return pii(a.first+b.first,a.second+b.second); }
pii operator-(const pii& a,const pii& b) { return pii(a.first-b.first,a.second-b.second); }

ll productVect(const pii& a,const pii& b)
{
	ll A = a.first;
	ll B = a.second;
	ll C = b.first;
	ll D = b.second;
	return A*D-B*C;
}

bool pii_comp_x( const pii& a,const pii &b) { return a.first < b.first; }

int underChain(const vpii& chn, const pii& pnt)
{
	if (chn[0].first > pnt.first || chn.back().first < pnt.first) return 0;
	int i = lower_bound(chn.begin(),chn.end(),pnt,pii_comp_x)-chn.begin();
	if (i) --i;
	return (productVect(chn[i+1]-chn[i],pnt-chn[i]) <= 0);
}

void convex_minko_sum(const vpii& a, const vpii& b, vpii& out)
{
	out.clear();
	int i=0,j=0;
	for (int q=0;q<a.size();++q) if (a[q]<a[i]) i=q;
	for (int q=0;q<b.size();++q) if (b[q]<b[j]) j=q;
	do
	{
		out.push_back( a[i]+b[j] );
		ll pro= productVect(a[(i+1)%a.size()]-a[i], b[(j+1)%b.size()]-b[j]);
		if (pro>=0)	i=(i+1)%a.size();
		if (pro<=0)	j=(j+1)%b.size();
	}
	while ( a[i]+b[j] != out[0] );
}

int main()
{
	vpii T[5];
	for (int q=0;q<3;++q)
	{
		int sz;
		scanf("%d",&sz);
		for (int w=0;w<sz;++w)
		{
			pii u;
			scanf("%d %d",&u.first,&u.second);
			T[q].push_back(u);
		}
	}
	convex_minko_sum( T[0],T[1],T[3]);
	convex_minko_sum( T[2],T[3],T[4]);

	vpii up,down;// up - x is decreasing, down - x is increasing
	for (int q=0;q<T[4].size();++q)
	{
		pii a = T[4][q];
		pii b = T[4][(q+1)%T[4].size()];
		if (a.first < b.first) //go down!
		{
			if (down.empty() || down.back()!=a) down.push_back(a);
			down.push_back(b);
		}
		if (a.first > b.first) // go up!
		{
			if (up.empty() || up.back()!=a) up.push_back(a);
			up.push_back(b);
		}
	}
	reverse(up.begin(),up.end());
	for (int q=0;q<down.size();++q) down[q].second *= -1;

	int Quest;
	scanf("%d",&Quest);
	for (int q=0;q<Quest;++q)
	{
		int a,b;
		scanf("%d %d",&a,&b); a*=3,b*=3;
		printf("%s\n",(underChain(up,pii(a,b)) && underChain(down,pii(a,-b)))?"YES":"NO");
	}

	return 0;
}

// ,

#include <bits/stdc++.h>
#define N 200010
#define db double
#define eps (1e-6)
#define For(i,x,y) for (i=x;i<=y;i++)
using namespace std;
const db ang=0.12321312321312;
struct ww {
	db x,y;
	inline bool operator == (const ww &A) {
		return abs(x-A.x)<eps&&abs(y-A.y)<eps;
	}
	inline void read() {
		int a,b;
		scanf("%d%d",&a,&b);
		x=cos(ang)*a-sin(ang)*b;
		y=sin(ang)*a+cos(ang)*b;
		//x=a,y=b;
	}
	inline ww operator - (const ww &A) {
		return (ww){x-A.x,y-A.y};
	}
	inline ww operator + (const ww &A) {
		return (ww){x+A.x,y+A.y};
	}
	inline db operator * (const ww &A) {
		return x*A.y-y*A.x;
	}
} a[N],b[N],c[N],O;
int i,j,k,n,m,K;
inline void get(ww a[N],int n) {
	int i,k=1;
	For(i,1,n) c[i]=a[i];
	For(i,2,n) if (a[i].x<a[k].x||a[i].x==a[k].x&&a[i].y<a[k].y) k=i;
	int t=0;
	for (i=k;i<=n;i++) a[++t]=c[i];
	For(i,1,k-1) a[++t]=c[i];
	a[n+1]=a[1]; a[n+2]=a[2];
}
inline void merge(ww a[N],ww b[N]) {
	int i,j,t=0;
	get(a,n); get(b,m);
	j=1; c[t=1]=a[1]+b[1];
	For(i,1,n+1) {
		ww A=a[i+1]-a[i];
		for (;;) {
			if (t>1&&c[1]==c[t]) break;
			ww B=b[j+1]-b[j];
			db C=A*B;
			if (A*B>eps) break;
			c[++t]=a[i]+b[j+1];
			j++;
		}
		if (t>1&&c[1]==c[t]) break;
		c[++t]=a[i+1]+b[j];
	}
	For(i,1,t) a[i]=c[i];
	n=t-1;
}
inline void pre() {
	scanf("%d",&n);
	For(i,1,n) a[i].read();
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
}
inline bool pan() {
	if (O==a[1]||O==a[K]) return 1;
	if (O.x<a[1].x||O.x>a[K].x) return 0;
	int l=1,r=K,mid;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x<O.x) l=mid+1;
		else r=mid-1;
	}
	int id=l-1;
	db y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y+eps<y) return 0;

	l=K,r=n+1;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x>O.x) l=mid+1;
		else r=mid-1;
	}
	id=l-1;
	y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y-eps>y) return 0;
	return 1;
}
int main() {
	pre();
	For(i,1,n) if (a[i].x>a[i+1].x) break;
	K=i;
	scanf("%d",&m);
	For(i,1,m) {
		O.read();
		O.x*=3,O.y*=3;
		printf("%s\n",pan()?"YES":"NO");
	}
	return 0;
}

    #include<bits/stdc++.h>
    using namespace std;
    #define fi first
    #define se second
    int angulo( pair< int, int > a , pair< int ,int  > b , pair< int , int > c , pair< int , int > d ){
        long long val = ( long long)( b.se - a.se ) *( d.fi - c.fi ) - (long long)( b.fi - a.fi )*( d.se - c.se );
        if ( val < 0  ) return 1;
        if ( val > 0  ) return 2;
        return 3;
    }
    vector< pair< int, int > > suma( vector< pair< int, int > > v1, vector< pair< int, int > > v2 ){
        vector< pair< int, int > > v3;
        int nn = v1.size();
        int mm = v2.size();
        int i = 0 , j = 0;
        for ( int a = 0 ; a < (int)v1.size(); a++ ){
            if ( v1[ a ].second < v1[ i ].second || v1[ a ].second == v1[ i].second && v1[ a ].first < v1[ i ].first  ){
                i= a;
            }
        }
        for ( int a = 0 ; a < (int)v2.size(); a++ ){
            if ( v2[ a ].second < v2[ j ].second || v2[ a ].second == v2[ j ].second && v2[ a ].first < v2[ j ].first  ){
                j= a;
            }
        }
        int conta = 0;
        int idx, idy;
        int z;
        while(1){
            v3.push_back( make_pair( v1[ i ].fi + v2[ j ].fi , v1[ i ].se + v2[ j ].se) );
            idx = ( i + 1 )%nn;
            idy = ( j + 1 )%mm;
            conta++;
            assert( conta <= 1000000 );
            z = angulo( v1[ i ] , v1[idx ] , v2[ j ] ,v2[ idy ] );
            if ( z == 1 ){
               i = idx;
            }else if(  z == 2 ){
                j = idy;
            }else{
                i = idx;
                j = idy;
            }
            if ( (v1[ i ].fi + v2[ j ].fi == v3[ 0 ].fi) && (v1[ i ].se + v2[ j ].se == v3[ 0 ].se)  ) break;
        }
        return v3;
    }
    long long area( pair< int , int > a, pair< int , int> b , int x , int y ){
        long long aa = b.fi - a.fi;
        long long bb = b.se- a.se;
        long long cc = x-a.fi;
        long long dd = y - a.se;
        return aa*dd - bb*cc;
    }
    bool isIn( vector< pair< int, int > > &A , int x, int y ){
	    int n = A.size(), lo = 1, hi = A.size() - 1;

	    if(area(A[0], A[1], x , y) < 0) return 0;
	    if(area(A[n-1], A[0], x , y) < 0) return 0;
	    int conta =0;
	    while(hi - lo > 1)
	    {
	        conta++;
		    int mid = (lo + hi) / 2;

	    assert( conta <= 50 );
		    if(area(A[0], A[mid], x, y ) > 0) lo = mid;
		    else hi = mid;
	    }
	    return area(A[lo], A[hi], x,y) >= 0;

    }
    int main(){
        int n , m , o;
        scanf("%d",&n);
        vector< pair< int, int > > v1, v2, v3;
        for ( int i = 0 ; i <n ; i++ ){
            int x,y;
            scanf("%d %d",&x,&y);
            v1.push_back( make_pair( x , y ) );
        }
        scanf("%d",&m);
        for ( int i = 0 ;i < m; i++ ){
            int x,y;
            scanf("%d %d",&x,&y);
           v2.push_back( make_pair( x , y ) );
        }
        scanf("%d",&o);
        for ( int i = 0; i < o ; i++ ){
            int x, y;
            scanf("%d %d",&x,&y);
           v3.push_back( make_pair( x , y ) );
        }
        vector< pair< int , int > > v4 = suma( v1 , v2 );
        int q;
        scanf("%d",&q);
        v4 = suma( v4 , v3 );
        vector< pair< int ,int > > v5;
        int i = 0 ;
        for ( int a = 0 ; a < (int)v4.size(); a++ ){
            if ( v4[ a ].second < v4[ i ].second || v4[ a ].second == v4[ i].second && v4[ a ].first < v4[ i ].first  ){
                i= a;
            }
        }

        for ( int a= i ; a< (int)v4.size(); a++ ){
            v5.push_back( v4[ a ] );
        }
        for ( int a = 0 ; a < i ; a++ ){
            v5.push_back( v4[ a ] );
        }
        for ( int i = 0 ; i < q ; i++ ){
            int x,y;
            scanf("%d %d", &x , &y );
            if ( isIn( v4 , x*3 , y*3 ) ){

                printf("YES\n");
            }else printf("NO\n");
        }
    }

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li       	long long int
#define rep(i,to)	for(li i=0;i<((li)(to));i++)
#define pb       	push_back
#define sz(v)    	((li)v.size())
#define bit(n)   	(1ll<<(li)(n))

#define MAX 50005
#define MP make_pair

bool is_upper(li x0,li y0,li x1,li y1,li X,li Y){
	return (y1-y0)*X+(x1-x0)*y0-(y1-y0)*x0<(x1-x0)*Y;
}

bool is_lower(li x0,li y0,li x1,li y1,li X,li Y){
	return (x1-x0)*Y<(y1-y0)*X+(x1-x0)*y0-(y1-y0)*x0;
}

int main(){
	li x[3][MAX],y[3][MAX],n[3],stage;
	li p[3]={0,0,0},cnt[3]={0,0,0};
	vector<li> vx,vy;
	rep(i,3){
		cin>>n[i];
		rep(j,n[i]) cin>>x[i][j]>>y[i][j];
	}
	rep(i,3)rep(j,n[i]){
		double d0=atan2(y[i][(j+1)%n[i]]-y[i][j],x[i][(j+1)%n[i]]-x[i][j]);
		double d1=atan2(y[i][p[i]+1]-y[i][p[i]],x[i][p[i]+1]-x[i][p[i]]);
		if(d0<d1) p[i]=j;
	}
	vx.pb(x[0][p[0]]+x[1][p[1]]+x[2][p[2]]);
	vy.pb(y[0][p[0]]+y[1][p[1]]+y[2][p[2]]);
	while(n[0]!=cnt[0] || n[1]!=cnt[1] || n[2]!=cnt[2]){
		li t=-1;
		rep(i,3)if(n[i]!=cnt[i]){
			if(t==-1){ t=i; continue; }
			double d0=atan2(y[i][(p[i]+1)%n[i]]-y[i][p[i]],x[i][(p[i]+1)%n[i]]-x[i][p[i]]);
			double d1=atan2(y[t][(p[t]+1)%n[t]]-y[t][p[t]],x[t][(p[t]+1)%n[t]]-x[t][p[t]]);
			if(d0<d1) t=i;
		}
		p[t]=(p[t]+1)%n[t];
		cnt[t]++;
		vx.pb(x[0][p[0]]+x[1][p[1]]+x[2][p[2]]);
		vy.pb(y[0][p[0]]+y[1][p[1]]+y[2][p[2]]);
	}
	li m0=0,m1=0;
	rep(i,sz(vx)){
		if(vx[i]<vx[m0]) m0=i;
		if(vx[m1]<vx[i]) m1=i;
	}
	vector<pair<li,li> > _up,_down,up,down;
	rep(i,sz(vx)){
		if(!is_upper(vx[m0],vy[m0],vx[m1],vy[m1],vx[i],vy[i])) _down.pb(MP(vx[i],vy[i]));
		if(!is_lower(vx[m0],vy[m0],vx[m1],vy[m1],vx[i],vy[i])) _up.pb(MP(vx[i],vy[i]));
	}
	sort(_up.begin(),_up.end());
	sort(_down.begin(),_down.end());
	rep(i,sz(_up)){
		if(sz(up)==0 || up.back().first!=_up[i].first) up.pb(_up[i]);
		else up.back().second=max(up.back().second,_up[i].second);
	}
	rep(i,sz(_down)){
		if(sz(down)==0 || down.back().first!=_down[i].first) down.pb(_down[i]);
		else down.back().second=min(down.back().second,_down[i].second);
	}
	for(cin>>stage;stage--;){
		li xx,yy;
		cin>>xx>>yy; xx*=3; yy*=3;
		vector<pair<li,li> >::iterator u1,u0,d1,d0;
		u0=upper_bound(up.begin(),up.end(),MP(xx,bit(60)));
		d0=upper_bound(down.begin(),down.end(),MP(xx,bit(60)));
		if(u0==up.begin() || d0==down.begin()){ cout<<"NO"<<endl; continue; }
		u1=u0--;
		d1=d0--;
		if(u1==up.end()){
			cout<<((xx==u0->first && d0->second<=yy && yy<=u0->second)?"YES":"NO")<<endl;
			continue;
		}
		bool ok=true;
		if(is_upper(u0->first,u0->second,u1->first,u1->second,xx,yy)) ok=false;
		if(is_lower(d0->first,d0->second,d1->first,d1->second,xx,yy)) ok=false;
		cout<<((ok)?"YES":"NO")<<endl;
	}
}

#include<bits/stdc++.h>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double lf;

ll cross(pii a, pii b) {
    return (ll)a.first*b.second - (ll)a.second*b.first;
}
ll ccw(pii a, pii b, pii c) {
    pii p = pii(b.first - a.first, b.second - a.second);
    pii q = pii(c.first - a.first, c.second - a.second);
    return cross(p, q);
}

struct CHT {
    vector<lf> M, B;
    void init() {
        M.clear();
        B.clear();
    }
    bool bad(int l1, int l2, int l3) {
        return (M[l1] - M[l2]) * (B[l3] - B[l1]) <= (M[l1] - M[l3]) * (B[l2] - B[l1]);
    }
    void add(lf m, lf b) {
        M.push_back(m);
        B.push_back(b);
        while(M.size() >= 3 && bad(M.size() - 3, M.size() - 2, M.size() - 1)) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
        if(M.size() == 2 && M[0] == M[1]) {
            M.erase(M.end() - 2);
            B.erase(B.end() - 2);
        }
    }
    lf query(lf x) {
        int s = 0, e = (int)M.size() - 2;
        int idx = 0;
        while(s <= e) {
            int m = (s + e)>>1;
            if((M[m] - M[m + 1]) * x >= (B[m + 1] - B[m])) {
                idx = m + 1;
                s = m + 1;
            }
            else e = m - 1;
        }
        return M[idx] * x + B[idx];
    }
} le, ri;

int N[3];
vector<pii> P[3];
vector<pii> mcsk;
int bo, to;

void getMcskSum() {
    mcsk = P[0];
    for(int i = 1; i <= 2; i++) {
        vector<pii> tmp = mcsk;

        mcsk.clear();
        mcsk.push_back(pii(tmp[0].first + P[i][0].first, tmp[0].second + P[i][0].second));

        int pos1 = 0, pos2 = 0;
        while(pos1 < tmp.size() && pos2 < P[i].size()) {
            int npos1 = (pos1 + 1) % tmp.size();
            int npos2 = (pos2 + 1) % P[i].size();

            pii vec1 = pii(tmp[npos1].first - tmp[pos1].first, tmp[npos1].second - tmp[pos1].second);
            pii vec2 = pii(P[i][npos2].first - P[i][pos2].first, P[i][npos2].second - P[i][pos2].second);

            if(ccw(pii(0, 0), vec1, vec2) <= 0) {
                pii nV = pii(mcsk.back().first + vec2.first, mcsk.back().second + vec2.second);
                mcsk.push_back(nV);
                pos2++;
            }
            else {
                pii nV = pii(mcsk.back().first + vec1.first, mcsk.back().second + vec1.second);
                mcsk.push_back(nV);
                pos1++;
            }
        }
        while(pos1 < tmp.size()) {
            int npos1 = (pos1 + 1) % tmp.size();
            pii vec1 = pii(tmp[npos1].first - tmp[pos1].first, tmp[npos1].second - tmp[pos1].second);
            pii nV = pii(mcsk.back().first + vec1.first, mcsk.back().second + vec1.second);
            mcsk.push_back(nV);
            pos1++;
        }
        while(pos2 < P[i].size()) {
            int npos2 = (pos2 + 1) % P[i].size();
            pii vec2 = pii(P[i][npos2].first - P[i][pos2].first, P[i][npos2].second - P[i][pos2].second);
            pii nV = pii(mcsk.back().first + vec2.first, mcsk.back().second + vec2.second);
            mcsk.push_back(nV);
            pos2++;
        }
    }
    bo = 1e9;
    to = -1e9;
    for(int i = 0; i < mcsk.size(); i++) {
        bo = min(bo, mcsk[i].second);
        to = max(to, mcsk[i].second);
    }
}

void getCHT() {
    le.init();
    ri.init();
    for(int i = 0; i < mcsk.size(); i++) {
        int j = (i + 1) % mcsk.size();

        pii vec = pii(mcsk[j].first - mcsk[i].first, mcsk[j].second - mcsk[i].second);
        if(vec.second == 0) continue;
        if(vec.second < 0) break;

        lf m = (lf)vec.first / vec.second;
        lf b = (lf)mcsk[i].first - m*mcsk[i].second;
        ri.add(m, b);
    }
    for(int i = mcsk.size(); i--;) {
        int j = (i + 1) % mcsk.size();

        pii vec = pii(mcsk[i].first - mcsk[j].first, mcsk[i].second - mcsk[j].second);
        if(vec.second == 0) continue;
        if(vec.second < 0) break;

        lf m = (lf)vec.first / vec.second;
        lf b = (lf)mcsk[j].first - m*mcsk[j].second;
        le.add(-m, -b);
    }
}

bool in(pii p) {
    if(p.second < bo || to < p.second) return false;
    lf lx = -le.query(p.second);
    lf rx = ri.query(p.second);
    return lx - 1e-12 <= p.first && p.first <= rx + 1e-12;
}

int main() {
    for(int i = 0; i < 3; i++) {
        scanf("%d", &N[i]);

        P[i].resize(N[i]);

        pii low = pii(1e9, 1e9);
        int lpos;
        for(int j = 0; j < N[i]; j++) {
            scanf("%d %d", &P[i][j].first, &P[i][j].second);

            if(low.second > P[i][j].second || (low.second == P[i][j].second && low.first > P[i][j].first)) {
                low = P[i][j];
                lpos = j;
            }
        }

        vector<pii> tmp;
        for(int j = lpos; j < N[i]; j++) tmp.push_back(P[i][j]);
        for(int j = 0; j < lpos; j++) tmp.push_back(P[i][j]);
        P[i] = tmp;
    }

    getMcskSum();
    getCHT();

    int M; scanf("%d", &M);
    for(int i = 0; i < M; i++) {
        int x, y; scanf("%d %d", &x, &y);
        if(in(pii(3*x, 3*y))) printf("YES\n");
        else printf("NO\n");
    }
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;
typedef pair<int,int> pii;
typedef vector<int> vi;

typedef complex<int64> point;
typedef vector<point> polygon;

polygon read(){
    int n; cin >> n;
    polygon p(n);
    for (int i = 0; i < n; ++i){
        int64 x, y;
        cin >> x >> y;
        p[i] = point(x, y);
    }
    return p;
}

void print(polygon p){
    for (auto pp : p)
        cout << pp << endl;
}

int64 cross(point a, point b){
    return imag(conj(a) * b);
}

namespace std
{
    bool operator<(point a, point b)
    {
        if (a.real() != b.real())
            return a.real() < b.real();
        return a.imag() < b.imag();
    }
}

polygon merge(polygon A, polygon B){
    int pos_a = min_element(A.begin(), A.end()) - A.begin();
    int pos_b = min_element(B.begin(), B.end()) - B.begin();

    int pnt_a = pos_a, pnt_b = pos_b;
    int m = 0;

    polygon P = {A[pos_a] + B[pos_b]};

    for (;;){
        point va = A[(pnt_a + 1) % A.size()] - A[pnt_a];
        point vb = B[(pnt_b + 1) % B.size()] - B[pnt_b];

        if (m & 1){
            point nxt = P.back() + vb;
            P.push_back(nxt);
            pnt_b++;
            if (pnt_b == B.size()) pnt_b = 0;
            if (pnt_b == pos_b) m |= 2;
        }
        else if (m & 2){
            point nxt = P.back() + va;
            P.push_back(nxt);
            pnt_a++;
            if (pnt_a == A.size()) pnt_a = 0;
            if (pnt_a == pos_a) m |= 1;
        }
        else{
            if (cross(va, vb) >= 0){
                point nxt = P.back() + va;
                P.push_back(nxt);
                pnt_a++;
                if (pnt_a == A.size()) pnt_a = 0;
                if (pnt_a == pos_a) m |= 1;
            }
            else{
                point nxt = P.back() + vb;
                P.push_back(nxt);
                pnt_b++;
                if (pnt_b == B.size()) pnt_b = 0;
                if (pnt_b == pos_b) m |= 2;
            }
        }

        if (m == 3) break;
    }

    P.pop_back();
    return P;
}

struct convex_container{
    polygon upper_envelop;
    polygon lower_envelop;

    convex_container(polygon p){
        int a = min_element(p.begin(), p.end()) - p.begin();
        int b = max_element(p.begin(), p.end()) - p.begin();

        int pnt = a;
        while (pnt != b){
            lower_envelop.push_back(p[pnt++]);
            if (pnt == p.size()) pnt = 0;
        }
        lower_envelop.push_back(p[pnt]);

        while (lower_envelop.back().real() == lower_envelop[lower_envelop.size() - 2].real())
            lower_envelop.pop_back();

        while (pnt != a){
            upper_envelop.push_back(p[pnt++]);
            if (pnt == p.size()) pnt = 0;
        }
        upper_envelop.push_back(p[pnt]);

        while (upper_envelop.back().real() == upper_envelop[upper_envelop.size() - 2].real())
            upper_envelop.pop_back();

        reverse(upper_envelop.begin(), upper_envelop.end());
    }

    bool contains(point p){
        if (p.real() < upper_envelop[0].real() || p.real() > upper_envelop.back().real())
            return false;

        int lo = 0, hi = upper_envelop.size() - 1;

        while (lo + 1 < hi){
            int m = (lo + hi) >> 1;
            if (upper_envelop[m].real() <= p.real()) lo = m;
            else hi = m;
        }

        if (cross(upper_envelop[lo + 1] - upper_envelop[lo], p - upper_envelop[lo]) > 0)
            return false;

        lo = 0, hi = lower_envelop.size() - 1;
        while (lo + 1 < hi){
            int m = (lo + hi) >> 1;
            if (lower_envelop[m].real() <= p.real()) lo = m;
            else hi = m;
        }

        if (cross(p - lower_envelop[lo], lower_envelop[lo + 1] - lower_envelop[lo]) > 0)
            return false;

        return true;
    }
};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    vector<polygon> cities(3);

    for (int i = 0; i < 3; ++i)
        cities[i] = read();

    cities[0] = merge(cities[0], cities[1]);
    cities[0] = merge(cities[0], cities[2]);

    convex_container cc(cities[0]);

    int q; cin >> q;
    while (q--){
        int64 x, y;
        cin >> x >> y;
        point p(x, y);

        if (cc.contains(p * 3LL)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;

struct pt
{
    int x, y;
    pt() {}
    pt(int x, int y): x(x), y(y) {}
} O(2e9, -1);
pt operator+ (pt a, pt b) {return {a.x + b.x, a.y + b.y};}
pt operator- (pt a, pt b) {return {a.x - b.x, a.y - b.y};}
int operator% (pt a, pt b) {return a.x * b.y - a.y * b.x;}
bool half(pt a) {return a.y > 0 || !a.y && a.x > 0;}
bool less_xy(pt a, pt b) {return a.y < b.y || a.y == b.y && a.x < b.x;}

bool operator< (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b > 0;
}

bool operator<= (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b >= 0;
}

vector<pt> p1, p2, p3, all;

void rotate(vector<pt>& p)
{
    int id = 0;
    for (int i = 0; i < p.size(); ++i)
        if (less_xy(p[i], p[id]))
            id = i;
    rotate(p.begin(), p.begin() + id, p.end());
    p.push_back(p[0]);
}

void accumulate()
{
    all.push_back(p1[0] + p2[0] + p3[0]);
    for (int i = 0, j = 0, k = 0; i < p1.size() - 1 || j < p2.size() - 1 || k < p3.size() - 1;)
    {
        pt v1 = i < p1.size() - 1 ? p1[i+1] - p1[i] : O, v2 = j < p2.size() - 1 ? p2[j+1] - p2[j] : O, v3 = k < p3.size() - 1 ? p3[k+1] - p3[k] : O;
        if (v1 <= v2 && v1 <= v3)
            all.push_back(all.back() + v1), i++;
        else if (v2 <= v1 && v2 <= v3)
            all.push_back(all.back() + v2), j++;
        else
            all.push_back(all.back() + v3), k++;
    }
}

bool in_triangle(pt p, pt a, pt b, pt c)
{
    return (b - a) % (p - a) >= 0 && (p - a) % (c - a) >= 0
        && (c - b) % (p - b) >= 0 && (p - b) % (a - b) >= 0
        && (a - c) % (p - c) >= 0 && (p - c) % (b - c) >= 0;
}

bool in_polygon(vector<pt>& v, pt p)
{
    int l = 0, r = all.size() - 1, m;
    while (r - l > 1)
    {
        m = (l + r) / 2;
        (p - all[0] < all[m] - all[0] ? r : l) = m;
    }
    return in_triangle(p, all[0], all[l], all[l+1]);
}

signed main()
{
    int n, m, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p1.push_back(p);
    }
    cin >> m;
    for (int i = 0; i < m; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p2.push_back(p);
    }
    cin >> k;
    for (int i = 0; i < k; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p3.push_back(p);
    }
    rotate(p1);
    rotate(p2);
    rotate(p3);
    accumulate();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        pt p;
        cin >> p.x >> p.y, p.x *= 3, p.y *= 3;
        cout << (in_polygon(all, p) ? "YES" : "NO") << '\n';
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

struct point {
	int x, y;
	void read() {
		scanf("%d%d", &x, &y);
	}
};

int n[3], N, start[3], pos[3], p1[3], p2[3];
point a[3][500005];
point b[2000005];

int area(point a, point b, point c) {
	long long res = 0LL + (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
	if (res < 0LL) return -1;
	if (res > 0LL) return  1;
	return 0;
}

void add(point p) {
	if (N >= 2 && area(b[N - 2], b[N - 1], p) <= 0) N--;
	b[N++] = p;
}

void Construct_Minkowski_Sum() {
	int i, j, k;
	for (i = 0; i < 3; ++i) {
		int ld = 0;
		for (j = 1; j < n[i]; ++j) {
			if (a[i][j].y < a[i][ld].y || (a[i][j].y == a[i][ld].y && a[i][j].x < a[i][ld].x)) ld = j;
		}
		start[i] = ld;
	}

	while (pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]) {
		for (i = 0; i < 3; ++i) {
			p1[i] = (start[i] + pos[i]) % n[i];
			p2[i] = (p1[i] + 1) % n[i];
		}
		//printf("(%d %d) (%d %d) (%d %d)\n", a[0][p1[0]].x, a[0][p1[0]].y, a[1][p1[1]].x, a[1][p1[1]].y, a[2][p1[2]].x, a[2][p1[2]].y);
		add({a[0][p1[0]].x + a[1][p1[1]].x + a[2][p1[2]].x, a[0][p1[0]].y + a[1][p1[1]].y + a[2][p1[2]].y});

		int next = -1;
		int dx = 0, dy = 0;
		for (i = 0; i < 3; ++i) if (pos[i] < n[i]) {
			int dx2 = a[i][p2[i]].x - a[i][p1[i]].x;
			int dy2 = a[i][p2[i]].y - a[i][p1[i]].y;
			int cmp = (dy > 0 || (dy == 0 && dx > 0)) ? 0 : 1;
			int cmp2 = (dy2 > 0 || (dy2 == 0 && dx2 > 0)) ? 0 : 1;
			bool ok = false;
			if (next == -1) ok = true;
			if (cmp < cmp2) ok = true;
			if (cmp == cmp2) {
				if (dx2 * dy - dy2 * dx > 0) ok = true;
			}
			if (ok) {
				dx = dx2;
				dy = dy2;
				next = i;
			}
		}
		pos[next]++;
	}
}

bool Centroid(int x, int y) {
	x *= 3, y *= 3;
	point p = {x, y};
	if (area(b[0], b[1], p) < 0) return 0;
	if (area(b[0], b[N - 1], p) > 0) return 0;
	int l = 0, r = N - 1;
	while (r - l > 1) {
		int mid = (r + l) / 2;
		if (area(b[0], b[mid], p) < 0) r = mid;
		else l = mid;
	}
	if (area(b[l], b[r], p) >= 0) return 1;
	return 0;
}

int main() {
	int i, j, k, m;
	for (i = 0; i < 3; ++i) {
		scanf("%d", &n[i]);
		for (j = 0; j < n[i]; ++j)
			a[i][j].read();
	}
	Construct_Minkowski_Sum();

	/*printf("%d\n", N);
	for (i = 0; i < N; ++i)
		printf("%d %d\n", b[i].x, b[i].y);*/

	scanf("%d", &m);
	for (i = 0; i < m; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		if (Centroid(x, y))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)

#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define SZ(a) (int((a).size()))
#define two(x) (1 << (x))
#define twoll(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()
#define CLR(a) (a).clear()

#define pb push_back
#define PF push_front
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef queue<int> qi;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n == 0)?0:1+count_bit(n&(n-1));}
inline bool bit_set(int a, int b){return (a&two(b));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const double pi=acos(-1);
int n, m;
vector<pii> a, b, c;
map<int, pii> tb;

ll crossp(ll a, ll b, ll c, ll d){return a*d-c*b;}
void sum(){
    int ia, ib;
    ia=ib=0;
    REP(i, n) if (a[i].ND<a[ia].ND || (a[i].ND==a[ia].ND && a[i].ST<a[ia].ST)) ia=i;
    REP(i, m) if (b[i].ND<b[ib].ND || (b[i].ND==b[ib].ND && b[i].ST<b[ib].ST)) ib=i;

    c.clear();
    c.pb(MP(a[ia].ST+b[ib].ST, a[ia].ND+b[ib].ND));
    int i, j;
    i=j=0;
    while(i<n || j<m){
        int t;
        if (i==n) t=1;
        else if (j==m) t=0;
        else{
            int k=(ia+i)%n, nk=(k+1)%n;
            double va=atan2(a[nk].ND-a[k].ND, a[nk].ST-a[k].ST);
            k=(ib+j)%m, nk=(k+1)%m;
            double vb=atan2(b[nk].ND-b[k].ND, b[nk].ST-b[k].ST);
            if (va<0) va+=2*pi;
            if (vb<0) vb+=2*pi;
            t=(va>vb);
        }

        if (t){
            int k=(ib+j)%m, nk=(k+1)%m;
            c.pb(MP(b[nk].ST-b[k].ST+c.back().ST, b[nk].ND-b[k].ND+c.back().ND));
            ++j;
        }else{
            int k=(ia+i)%n, nk=(k+1)%n;
            c.pb(MP(a[nk].ST-a[k].ST+c.back().ST, a[nk].ND-a[k].ND+c.back().ND));
            ++i;
        }

    }
    a=c;
    a.pop_back();
    n=a.size();
}

int query(int x, int y){

    //REP(i, n) printf("%d %d\n", a[i].ST, a[i].ND);
    //printf("q %d %d\n", x, y);

    map<int, pii>::iterator it=tb.lower_bound(y);
    if (it==tb.end() || y>it->ST) return 0;
    int i=it->ND.ST, j=i+1;
    if (x<min(a[i].ST, a[j].ST)) return 0;

    if (crossp(a[j].ST-a[i].ST, a[j].ND-a[i].ND, x-a[i].ST, y-a[i].ND)>0) return 0;
    i=it->ND.ND, j=i+1;
    if (x>max(a[i].ST, a[j].ST)) return 0;
    if (crossp(a[j].ST-a[i].ST, a[j].ND-a[i].ND, x-a[i].ST, y-a[i].ND)>0) return 0;

    return 1;

}

int main(){
    cin>>n;
    a.resize(n);
    REP(i, n) cin>>a[i].ST>>a[i].ND;

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    tb.clear();
    REP(i, n) tb[a[i].ND]=MP(-1, -1);
    int va=tb.begin()->ST;
    int vb=(--tb.end())->ST;

    a.pb(a[0]);
    reverse(ALL(a));
    int i=0;
    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) ++i;
        it->ND.ST=i-1;
    }
    i=n-1;

    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) --i;
        it->ND.ND=i+1;
    }

    int k;
    cin>>k;
    REP(i, k){
        int x, y;
        cin>>x>>y;
        x*=3, y*=3;
        if (query(x, y)) printf("YES\n");
        else printf("NO\n");

    }

}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define point pair<int,int>
using namespace std;

long long crossProduct(point A,point B,point C)
{
    long long ax = B.first - A.first,ay = B.second - A.second;
    long long bx = C.first - B.first,by = C.second - B.second;
    return 1LL * ax * by - 1LL * ay * bx;
}

int ccw(point A,point B,point C)
{
    long long tmp = crossProduct(A,B,C);
    if (tmp > 0) return 1; else if (tmp < 0) return -1; else return 0;
}

point sum(point A,point B)
{
    return make_pair(A.first + B.first,A.second + B.second);
}

struct polygon
{
    vector< point > vertices,leftBorder,rightBorder;

    void loadPolygon()
    {
        int n;
        scanf("%d", &n);
        vertices.resize(n);
        for (int i = 0; i < n; i++) scanf("%d %d", &vertices[i].first, &vertices[i].second);
    }

    void prepareBorder()
    {
        int miny = vertices[0].second,maxy = vertices[0].second;
        for (int i = 1; i < vertices.size(); i++)
        {
            miny = min(miny,vertices[i].second);
            maxy = max(maxy,vertices[i].second);
        }

        int rightStart;
        for (rightStart = 0; rightStart < vertices.size(); rightStart++)
          if (vertices[rightStart].second == miny && vertices[(rightStart + 1) % vertices.size()].second > miny) break;
        for (int i = rightStart; ; i = (i + 1) % vertices.size())
        {
            rightBorder.push_back(vertices[i]);
            if (vertices[i].second == maxy) break;
        }

//        for (int i = 0; i < rightBorder.size(); i++) cout << rightBorder[i].first << ' ' << rightBorder[i].second << endl;
//        cout << endl;

        int leftStart;
        for (leftStart = 0; leftStart < vertices.size(); leftStart++)
          if (vertices[leftStart].second == maxy && vertices[(leftStart + 1) % vertices.size()].second < maxy) break;
        for (int i = leftStart; ; i = (i + 1) % vertices.size())
        {
            leftBorder.push_back(vertices[i]);
            if (vertices[i].second == miny) break;
        }

//        for (int i = 0; i < leftBorder.size(); i++) cout << leftBorder[i].first << ' ' << leftBorder[i].second << endl;
    }

    bool inside(point X)
    {
        int low,high,mid,leftPos = -1,rightPos = -1;

        low = 0;  high = leftBorder.size() - 1;
        while (low <= high)
        {
            mid = (low + high)/2;
            if (leftBorder[mid].second >= X.second)
            {
                leftPos = mid;  low = mid + 1;
            }
            else high = mid - 1;
        }
        if (leftPos == leftBorder.size() - 1) leftPos--;
        if (leftPos < 0) return false;

        low = 0;  high = rightBorder.size() - 1;
        while (low <= high)
        {
            mid = (low + high)/2;
            if (rightBorder[mid].second <= X.second)
            {
                rightPos = mid;  low = mid + 1;
            }
            else high = mid - 1;
        }
        if (rightPos == rightBorder.size() - 1) rightPos--;
        if (rightPos < 0) return false;

        int z = 1;
        z *= ccw(leftBorder[leftPos],leftBorder[leftPos + 1],X);
        z *= ccw(rightBorder[rightPos],rightBorder[rightPos + 1],X);
        return (z >= 0);
    }

    polygon MinkowskiSum(polygon A,polygon B)
    {
        int startA = 0,startB = 0;
        for (int i = 1; i < A.vertices.size(); i++)
          if (A.vertices[i] < A.vertices[startA]) startA = i;
        for (int i = 1; i < B.vertices.size(); i++)
          if (B.vertices[i] < B.vertices[startB]) startB = i;

        int finishA = startA,finishB = startB;
        polygon C;
        while (1)
        {
            C.vertices.push_back(sum(A.vertices[startA],B.vertices[startB]));
            int nextA = (startA + 1) % A.vertices.size(),nextB = (startB + 1) % B.vertices.size();

            point p1 = A.vertices[startA],p2 = A.vertices[nextA],p3 = B.vertices[startB],p4 = B.vertices[nextB];
            long long ax = p2.first - p1.first,ay = p2.second - p1.second,bx = p4.first - p3.first,by = p4.second - p3.second;
            long long direc = 1LL * ax * by - 1LL * ay * bx;
            if (direc >= 0) startA = nextA;
            if (direc <= 0) startB = nextB;
            if (startA == finishA && startB == finishB) break;
        }
        return C;
    }
} P[3];

int main()
{
    //freopen("e.in","r",stdin);
    for (int i = 0; i < 3; i++) P[i].loadPolygon();
    for (int i = 1; i < 3; i++) P[0] = P[0].MinkowskiSum(P[0],P[i]);

    P[0].prepareBorder();
    int Q;  scanf("%d", &Q);
    while (Q--)
    {
        pair<int,int> X;  scanf("%d %d", &X.first, &X.second);
        X.first *= 3;  X.second *= 3;
        if (P[0].inside(X)) printf("YES\n"); else printf("NO\n");
    }
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const int maxn=5e5+6;
const int mod=1e9+7;
const double pi=acos(-1.0);
const double eps=1e-8;
struct Point{
	double x,y;
	Point(double x=0, double y=0):x(x),y(y) {};
};
typedef Point Vector;
Point F[maxn],p[maxn],p1[maxn],p2[maxn],p3[maxn],v1[maxn],v2[maxn];
int stk[maxn];
int top=0,cnt;
int sgn(double x){
	if(fabs(x)<eps)
	    return 0;
	if(x<0)
	    return -1;
	return 1;
}
bool operator == (const Point &a, const Point &b){
	if(sgn(a.x-b.x)==0&&sgn(a.y-b.y)==0)
	   return true;
	else
	   return false;
}
Vector operator - (Point A, Point B){
	return Vector(A.x-B.x, A.y-B.y);
}
Vector operator + (Vector A, Vector B){
	return Vector(A.x+B.x, A.y+B.y);
}
//向量与常数的除法
Vector operator / (Vector A, double p){
	return Vector(A.x/p, A.y/p);
}
Vector operator * (Vector A, double p){
	return Vector(A.x*p, A.y*p);
}
double Dot(Vector A,Vector B){  //锐角为正，钝角为负，直角为0
	return A.x*B.x + A.y*B.y;
}
double Cross(Vector v0, Vector v1){
	return v0.x*v1.y - v0.y*v1.x;
}
double Dis(Point p1, Point p2){
	return sqrt((p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y));
}
double Length(Vector t){
	return t.x*t.x+t.y*t.y;
}
bool cmp1(const Point &A,const Point &B) {
    return sgn(A.y-B.y)<0||((sgn(A.y-B.y)==0&&sgn(A.x-B.x)<0));
}
//极角排序,角度相同的则距离小的在前面
bool cmp2(const Point &A, const Point &B){
    return sgn(Cross(A,B))>0||(sgn(Cross(A,B))==0&&sgn(Length(A)-Length(B))<0);
}
//GrahamScan算法求凸包
void Graham(Point *lst,int &n){
	sort(lst+1,lst+n+1,cmp1);
	Point bs=lst[1];
	top=1;
	stk[top]=1;
	for(int i=1;i<=n;i++)
	  lst[i]=lst[i]-bs;
	sort(lst+2, lst+n+1, cmp2);//极角排序
	for(int i=2;i<=n;i++){
		while(top>1&&sgn(Cross(lst[i]-lst[stk[top-1]],lst[stk[top]]-lst[stk[top-1]]))>=0)
		   top--;
		stk[++top]=i;
	}
	for(int i=1;i<=top;i++)
	   lst[i]=lst[stk[i]]+bs;
    n=top;
	lst[top+1]=lst[1];
    return ;
}
void Minkowski(Point *A,int n,Point *B,int m,Point *C){    //求闵可夫斯基和
	for(int i=1;i<=n;i++)
	    v1[i]=A[i+1]-A[i];
	for(int i=1;i<=m;i++)
	    v2[i]=B[i+1]-B[i];
	cnt=1;
	C[cnt]=A[1]+B[1];
	int p1=1,p2=1;
	while(p1<=n&&p2<=m){
		++cnt;
		if(sgn(Cross(v1[p1],v2[p2]))>=0)
		    C[cnt]=C[cnt-1]+v1[p1++];
		else
		    C[cnt]=C[cnt-1]+v2[p2++];
	}
	while(p1<=n){
		++cnt;
		C[cnt]=C[cnt-1]+v1[p1++];
	}
	while(p2<=m){
		++cnt;
		C[cnt]=C[cnt-1]+v2[p2++];
	}
}
int in(Point a,Point *C,int size){   //二分判断点是否在凸包内
	if(sgn(Cross(a,C[1]))>0||sgn(Cross(C[size],a))>0)
	    return 0;
	int ps=lower_bound(C+1,C+size+1,a,cmp2)-C-1;
	return sgn(Cross(a-C[ps],C[ps%size+1]-C[ps]))<=0;
}
int main(){
	int n1,n2,n3;
	scanf("%d",&n1);
	for(int i=1;i<=n1;i++)
		scanf("%lf%lf",&p1[i].x,&p1[i].y);
	scanf("%d",&n2);
	for(int i=1;i<=n2;i++)
		scanf("%lf%lf",&p2[i].x,&p2[i].y);
	scanf("%d",&n3);
	for(int i=1;i<=n3;i++)
	    scanf("%lf%lf",&p3[i].x,&p3[i].y);
	Graham(p1,n1);
	Graham(p2,n2);
	Graham(p3,n3);
	Minkowski(p1,n1,p2,n2,p);
	int n=cnt;
    Graham(p,n);
    Minkowski(p,n,p3,n3,F);
    Graham(F,cnt);
    Point bs=F[1];
	for(int i=cnt;i>=1;i--)
	    F[i]=F[i]-F[1];
	int T;
	scanf("%d",&T);
	while(T--){
		Point t;
		scanf("%lf%lf",&t.x,&t.y);
		if(in(t*3.0-bs,F,cnt))
		   printf("YES\n");
		else
		   printf("NO\n");
	}
	return 0;
}

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define bit(n) (1<<(n))
#define bit64(n) ((LL(1))<<(n))
#define inf 1000000000
#define eps 1e-9
#define PI 3.1415926535897932385
#define pb push_back
#define sz size()
#define mp make_pair
#define cl clear()
#define all(a) (a).begin(),(a).end()
#define fill(ar,val) memset(ar,val,sizeof ar)
#define MIN(a,b) {if(a>(b)) a=(b);}
#define MAX(a,b) {if(a<(b)) a=(b);}
#define sqr(x) ((x)*(x))
#define X first
#define Y second

//clock_t start=clock();
//fprintf(stderr,"time=%.3lfsec\n",0.001*(clock()-start));

int half(LL x,LL y)
{
	return x>0 || x==0 & y>0;
}

struct point
{
	LL x,y;
	point(){}
	point(LL x_,LL y_){x=x_;y=y_;}
	bool operator<(const point &a) const
	{
		int h=half(x,y);
		int ah=half(a.x,a.y);
		if(h!=ah) return h>ah;
		return LL(x)*a.y>LL(a.x)*y;
	}
	bool operator==(const point &a) const
	{
		return half(x,y)==half(a.x,a.y) && x*a.y==a.x*y;
	}
};

#define N 155555
LL x[N],y[N];
point a[N];

int main()
{
#ifdef XDEBUG
	freopen("e.in","r",stdin);
#endif
	int n;
	while(scanf("%d",&n)>0)
	{
		LL sx=0,sy=0;
		int i,j,k;
		int m=0;
		for(j=0;j<3;j++)
		{
			if(j) scanf("%d",&n);
			int mini=0;
			for(i=0;i<n;i++)
			{
				scanf("%I64d%I64d",x+i,y+i);
				if(mp(x[mini],y[mini])>mp(x[i],y[i]))
					mini=i;
			}
			sx+=x[mini];
			sy+=y[mini];
			for(i=0;i<n;i++)
				a[m++]=point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]);
		}
		sort(a,a+m);
		for(i=k=0;i<m;i=j)
		{
			LL ax=0,ay=0;
			for(j=i;j<m && a[i]==a[j];j++)
				ax+=a[j].x,ay+=a[j].y;
			a[k++]=point(ax,ay);
		}
		m=k;
		x[0]=sx,y[0]=sy;
		for(i=0;i<m-1;i++)
		{
			x[i+1]=x[i]+a[i].x;
			y[i+1]=y[i]+a[i].y;
		}
		for(i=0;i<m;i++) printf("%I64d %I64d\n",x[i],y[i]);
		int q;
		for(scanf("%d",&q);q--;)
		{
			LL u,v;
			scanf("%I64d%I64d",&u,&v);
			u*=3;
			v*=3;
			//u=5,v=1;
			if(u<sx || u==sx && v<sy){puts("NO");continue;}
			if(u==sx && v==sy){puts("YES"); continue;}
			if((u-sx)*(y[m-1]-sy)<(v-sy)*(x[m-1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[m-1]-sy)==(v-sy)*(x[m-1]-sx))
			{
				puts(x[0]<x[m-1] && u<=x[m-1] || x[0]==x[m-1] && v<=y[m-1]?"YES":"NO");
				continue;
			}
			if((u-sx)*(y[1]-sy)>(v-sy)*(x[1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[1]-sy)==(v-sy)*(x[1]-sx))
			{
				puts(u<=x[1]?"YES":"NO");
				continue;
			}
			int L=0;
			int R=m;
			while(L+1<R)
			{
				int M=(L+R)/2;
				LL vect=LL(u-sx)*(y[M]-sy)-LL(v-sy)*(x[M]-sx);
				if(vect<=0) L=M; else R=M;
			}
			if(0<L && R<m)
			{
				LL vect=LL(x[R]-u)*(y[L]-v)-LL(y[R]-v)*(x[L]-u);
				puts(vect>0?"NO":"YES");
			}
		}
	}
	return 0;
}

#include <stdio.h>
#include <algorithm>

using namespace std;

#define INF 100000000000000LL

class PT{
    public:
	long long x,y;
	PT(){}
	PT(long long _x,long long _y){
	    x=_x; y=_y;
	}
	PT operator+(const PT& p) const {
	    return PT(x+p.x,y+p.y);
	}
	PT operator-(const PT& p) const {
	    return PT(x-p.x,y-p.y);
	}
	long long operator^(const PT& p) const {
	    return x*p.y-y*p.x;
	}
	int POS(){
	    if(y==0) return x>0?0:1;
	    return y>0?0:1;
	}
};

PT pt[300000];
PT qt[300000];
PT rt[300000];
long long Lx,Rx;
int dn,un;

inline long long tri(PT p1,PT p2,PT p3){
    return (p2-p1)^(p3-p1);
}

inline bool cmp(PT a,PT b){
    int pa=a.POS();
    int pb=b.POS();
    if(pa==pb) return (a^b)>0;
    return pa<pb;
}

int minkowskiSum(int n,int m){
    int i,j,r,p,q,fi,fj;
    for(i=1,p=0;i<n;i++){
	if(pt[i].y<pt[p].y || (pt[i].y==pt[p].y && pt[i].x<pt[p].x)) p=i;
    }
    for(i=1,q=0;i<m;i++){
	if(qt[i].y<qt[q].y || (qt[i].y==qt[q].y && qt[i].x<qt[q].x)) q=i;
    }
    rt[0]=pt[p]+qt[q];
    r=1; i=p; j=q; fi=fj=0;
    while(1){
	if((fj&&j==q) || ((!fi||i!=p) && cmp(pt[(p+1)%n]-pt[p],qt[(q+1)%m]-qt[q]))){
	    rt[r]=rt[r-1]+pt[(p+1)%n]-pt[p];
	    p=(p+1)%n;
	    fi=1;
	}else{
	    rt[r]=rt[r-1]+qt[(q+1)%m]-qt[q];
	    q=(q+1)%m;
	    fj=1;
	}
	if(r<=1 || ((rt[r]-rt[r-1])^(rt[r-1]-rt[r-2]))!=0) {
	    r++;
	}else{
	    rt[r-1]=rt[r];
	}
	if(i==p && j==q) break;
    }
    return r-1;
}

void initInConvex(int n){
    int i,p,q;
    long long Ly,Ry;
    Lx=INF;
    Rx=-INF;
    for(i=0;i<n;i++){
	if(pt[i].x<Lx) Lx=pt[i].x;
	if(pt[i].x>Rx) Rx=pt[i].x;
    }
    Ly=Ry=INF;
    for(i=0;i<n;i++){
	if(pt[i].x==Lx && pt[i].y<Ly){
	    Ly=pt[i].y; p=i;
	}
	if(pt[i].x==Rx && pt[i].y<Ry){
	    Ry=pt[i].y; q=i;
	}
    }
    dn=0;
    for(i=p;i!=q;i=(i+1)%n){
	qt[dn++]=pt[i];
    }
    qt[dn]=pt[q];
    Ly=Ry=-INF;
    for(i=0;i<n;i++){
	if(pt[i].x==Lx && pt[i].y>Ly){
	    Ly=pt[i].y; p=i;
	}
	if(pt[i].x==Rx && pt[i].y>Ry){
	    Ry=pt[i].y; q=i;
	}
    }
    un=0;
    for(i=p;i!=q;i=(i+n-1)%n){
	rt[un++]=pt[i];
    }
    rt[un]=pt[q];
}

inline int inConvex(PT p){
    int L,R,M;
    if(p.x<Lx || p.y>Rx) return 0;
    L=0;R=dn;
    while(L<R-1){
	M=(L+R)/2;
	if(p.x<qt[M].x) R=M;
	else L=M;
    }
    if(tri(qt[L],qt[R],p)<0) return 0;
    L=0;R=un;
    while(L<R-1){
	M=(L+R)/2;
	if(p.x<rt[M].x) R=M;
	else L=M;
    }
    if(tri(rt[L],rt[R],p)>0) return 0;
    return 1;
}

int main(){
    int n,m,i;
    PT p;
    scanf("%d",&n);
    for(i=0;i<n;i++){
	scanf("%I64d %I64d",&pt[i].x,&pt[i].y);
    }
    scanf("%d",&m);
    for(i=0;i<m;i++){
	scanf("%I64d %I64d",&qt[i].x,&qt[i].y);
    }
    n=minkowskiSum(n,m);
    for(i=0;i<n;i++){
	pt[i]=rt[i];
    }
    scanf("%d",&m);
    for(i=0;i<m;i++){
	scanf("%I64d %I64d",&qt[i].x,&qt[i].y);
    }
    n=minkowskiSum(n,m);
    for(i=0;i<n;i++){
	pt[i]=rt[i];
    }
    initInConvex(n);
    scanf("%d",&m);
    for(i=0;i<m;i++){
	scanf("%I64d %I64d",&p.x,&p.y);
	p.x*=3;
	p.y*=3;
	puts(inConvex(p)?"YES":"NO");
    }
    return 0;
}

#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <sstream>

using namespace std;

#define forn(i, n) for(int i = 0; i < int(n); ++i)
#define for1(i, n) for(int i = 1; i <= int(n); ++i)
#define ford(i, n) for(int i = int(n) - 1; i >= 0; --i)
#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
#define sz(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define X first
#define Y second

typedef long long li;
typedef long double ld;
typedef pair<li, li> pt;

template<typename T> T abs(T a) { return a < 0 ? -a : a; }
template<typename T> T sqr(T a) { return a*a; }

const int INF = (int)1e9;
const ld EPS = 1e-9;
const ld PI = 3.1415926535897932384626433832795;

inline pt operator - (const pt& a, const pt& b){
    return pt(a.X - b.X, a.Y - b.Y);
}

inline pt operator + (const pt& a, const pt& b){
    return pt(a.X + b.X, a.Y + b.Y);
}

inline int vmulS(const pt& a, const pt& b){
    li res = a.X*b.Y - a.Y*b.X;
    if(res == 0)
        return 0;
    else
        return (res < 0) ? -1 : 1;
}

inline int side(const pt& a){
    if(a.X == 0)
        return (a.Y > 0) ? 1 : -1;
    return (a.X > 0) ? 1 : -1;
}

inline bool cmpAng(const pt& a, const pt& b){
    if(side(a) != side(b))
        return side(a) > side(b);
    return vmulS(a, b) < 0;
}

int n;
pt p[300500];

int m;
pt a[300500];

int szs;
pt s[300500];

pt buf[300500];

inline li area(const pt& a, const pt& b, const pt& c){
    return abs((b.X - a.X)*(c.Y - a.Y) - (b.Y - a.Y)*(c.X - a.X));
}

inline bool mid(const pt& a, const pt& b, const pt& c){
    return min(a.X, b.X) <= c.X && c.X <= max(a.X, b.X) &&
           min(a.Y, b.Y) <= c.Y && c.Y <= max(a.Y, b.Y);
}

inline bool onSeg(const pt& a, const pt& b, const pt& c){
    li A = b.Y - a.Y;
    li B = a.X - b.X;
    li C = -A*a.X - B*a.Y;

    return A*c.X + B*c.Y + C == 0 && mid(a, b, c);
}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        //freopen("output.txt", "wt", stdout);
    #endif

    pt st;
    forn(q, 3){
        cin >> n;

        pt mn(INF, INF);

        forn(i, n){
            scanf("%I64d %I64d", &p[i].X, &p[i].Y);
            mn = min(mn, p[i]);
        }

        st = st + mn;

        forn(i, n)
            s[szs++] = p[i] - (i + 1 == n ? p[0] : p[i + 1]);
    }

    sort(s, s + szs, cmpAng);

    n = 0;
    for(int i = 0; i < szs;){
        p[n++] = st;
        st = st + s[i];
        int j = i + 1;
        while(j < szs && vmulS(s[i], s[j]) == 0){
            st = st + s[j];
            ++j;
        }
        i = j;
    }

    if(p[0] != st)
        throw;

    /*{
        vector<pt> test;
        test.push_back(pt( 1,  0));
        test.push_back(pt(-1,  0));
        test.push_back(pt( 0, -1));
        test.push_back(pt( 0,  1));
        test.push_back(pt( 1,  1));
        test.push_back(pt( 1, -1));
        test.push_back(pt(-1,  1));
        test.push_back(pt(-1, -1));

        sort(all(test), cmpAng);

        forn(i, sz(test))
            cerr << test[i].X << " " << test[i].Y << endl;
        cerr << endl;
    }*/

    cin >> m;

    cerr << m << endl;

    forn(q, m){
        pt c;
        scanf("%I64d %I64d", &c.X, &c.Y);
        c.X *= 3;
        c.Y *= 3;

        bool good = false;

        if(c.X >= p[0].X){
            if(onSeg(p[0], p[1], c) || onSeg(p[n - 1], p[0], c))
                good = true;

            if(!good){
                int lf = 1, rg = n - 1;

                pt sp = c - p[0];

                while(rg - lf > 3){
                    int mid = lf + ((rg - lf) >> 1);

                    if(cmpAng(p[mid] - p[0], sp - p[0]))
                        lf = mid;
                    else
                        rg = mid;
                }

                for(int mid = lf; mid <= rg; ++mid){
                    if((mid != 1 && mid != n - 1 && area(p[0], p[mid - 1], p[mid]) ==
                       area(p[0], p[mid - 1], c) + area(p[0], p[mid], c) + area(p[mid - 1], p[mid], c)) ||
                       onSeg(p[mid - 1], p[mid], c))
                        good = true;
                }
            }

        }

        puts(good ? "YES" : "NO");
    }

    return 0;
}

// WA on test2

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

typedef long long I64; typedef unsigned long long U64;
typedef pair<int,int> PII;

struct Point {
  I64 x,y;

  Point() {}
  Point(int x,int y):x(x),y(y) {}

  Point& operator+=(Point p) {
    x+=p.x;
    y+=p.y;
    return *this;
  }
  Point& operator-=(Point p) {
    x-=p.x;
    y-=p.y;
    return *this;
  }

  friend Point operator+(const Point& p,const Point &q) {
    Point r=p;
    r+=q;
    return r;
  }
  friend Point operator-(const Point& p,const Point &q) {
    Point r=p;
    r-=q;
    return r;
  }
};

I64 CrossProduct(const Point& p, const Point& q) {
  return p.x*q.y-p.y*q.x;
}

int GetQuadrant(const Point& p) {
  if(p.x>0 && p.y>=0) return 1;
  if(p.x<=0 && p.y>0) return 2;
  if(p.x<0 && p.y<=0) return 3;
  return 4;
}

bool LessAngle(const Point& p,const Point& q) {
  int q_p=GetQuadrant(p),q_q=GetQuadrant(q);
  if(q_p!=q_q) return q_p<q_q;
  return CrossProduct(p,q)>0;
}

struct Convex {
  int n;
  vector<Point> p;

  void Read() {
    scanf("%d",&n);
    p.resize(n+1);
    int x,y;
    for(int i=0;i<n;++i) {
      scanf("%d%d",&x,&y);
      p[i].x=x;
      p[i].y=y;
    }
    p[n]=p[0];
    Normalize();
  }

  void Normalize() {
    Point first;
    int k=-1;

    for(int i=0;i<n;++i) {
      Point v=p[i+1]-p[i];
      if(i==0 || LessAngle(v,first)) {
        first=v;
        k=i;
      }
    }

    rotate(p.begin(),p.begin()+k,p.begin()+n);
    p[n]=p[0];
  }

  void CleanDup() {
    vector<Point> d(n);
    int tail=1;
    d[0]=p[0];
    d[1]=p[1];

    Point prev=d[1]-d[0];
    for(int i=2;i<=n;++i) {
      Point v=p[i]-d[tail];
      if(CrossProduct(prev,v)==0) d[tail]=p[i];
      else d[++tail]=p[i];
      prev=d[tail]-d[tail-1];
    }
    d.resize(tail+1);
    n=tail;
    p=d;
  }

  bool Contains(const Point &q) const {
    int low=1,high=n-1,mid;
    Point v=q-p[0];
    if(v.x==0 && v.y==0) return true;

    while(low<=high) {
//      printf("%d %d\n",low,high);
      mid=(low+high)>>1;
      if(LessAngle(p[mid]-p[0],v)) low=mid+1; else high=mid-1;
    }

    if(high<1) return false;
    if(high==n-1) return !LessAngle(p[high]-p[0],v);
    return CrossProduct(p[high]-v,p[high+1]-v)>=0;
  }

  void Output() const {
    printf("%d\n",n);
    for(int i=0;i<n;++i) printf("(%lld, %lld) ",p[i].x,p[i].y);
    printf("\n");
  }
};

void Combine(const Convex& P, const Convex& Q, Convex& R) {
//  P.Output();
//  Q.Output();

  R.n=P.n+Q.n;
  R.p.resize(R.n+1);
  R.p[0]=Point(0,0);
  Point minR=R.p[0];

  int iP=0,iQ=0,iR=0;
  Point vP=P.p[1]-P.p[0],vQ=Q.p[1]-Q.p[0];
  Point minP(P.p[0].x,P.p[0].y);
  Point minQ(Q.p[0].x,Q.p[0].y);

  while(iP<P.n || iQ<Q.n) {
    bool moveP;
    if(iP==P.n) moveP=0;
    else if(iQ==Q.n) moveP=1;
    else moveP=LessAngle(vP,vQ);

    ++iR;
    if(moveP) {
      R.p[iR]=R.p[iR-1]+vP;
      ++iP;
      minP.x=min(minP.x,P.p[iP].x);
      minP.y=min(minP.y,P.p[iP].y);
      vP=P.p[iP+1]-P.p[iP];
    } else {
      R.p[iR]=R.p[iR-1]+vQ;
      ++iQ;
      minQ.x=min(minQ.x,Q.p[iQ].x);
      minQ.y=min(minQ.y,Q.p[iQ].y);
      vQ=Q.p[iQ+1]-Q.p[iQ];
    }

    minR.x=min(minR.x,R.p[iR].x);
    minR.y=min(minR.y,R.p[iR].y);
  }

  Point t=minP+minQ;
  for(int i=0;i<R.n;++i) {
    R.p[i]-=minR;
    R.p[i]+=t;
  }
  R.p[R.n]=R.p[0];
  R.CleanDup();
}

Convex a;

void PreCom() {
  Convex b,c;

  a.Read();
  for(int i=0;i<2;++i) {
    b.Read();
    Combine(a,b,c);
    a=c;
  }
}

void Solve() {
  Point p;
  int n;
  int x,y;
  scanf("%d",&n);
  while(n--) {
    scanf("%d%d",&x,&y);
    p.x=x,p.y=y;
    p.x*=3;p.y*=3;
    if(a.Contains(p)) printf("YES\n"); else printf("NO\n");
  }
}

int main() {
  PreCom();
//  a.Output();
  Solve();

  return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

#define N 100005
#define LL long long

struct Point {
    LL x, y;
    Point(LL x = 0, LL y = 0):x(x), y(y) {}
    bool operator < (const Point & b) const {
        if (y != b.y) return y < b.y;
        return x < b.x;
    }
    Point operator + (const Point & b) {
        return Point(x + b.x, y + b.y);
    }
    Point operator - (const Point & b) {
        return Point(x - b.x, y - b.y);
    }
};

int n;
int sz[N], st[3];
Point p[3][N], v[3][N], a[N*3], b[N*3], o;

inline int sta(const Point & a) {
	return a.y > 0 || (a.y == 0 && a.x >= 0);
}

bool cmp(const Point & a, const Point & b) {
	int s1 = sta(a), s2 = sta(b);
	if (s1 != s2) return s1 > s2;
    return a.x * b.y - a.y * b.x > 0;
}

inline LL cross(const Point & a, const Point & b) {
    return a.x * b.y - a.y * b.x;
}

inline LL len(const Point & a) {
    return a.x * a.x + a.y * a.y;
}

bool gao(Point v) {
    if (v < o) return 0;
    v = v - o;
    int l = 0, r = n-1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (cross(a[mid], v) >= 0) l = mid + 1;
        else r = mid - 1;
    }
    --l;
    if (l == n-1)
        return  cross(v, a[l]) == 0 && len(v) <= len(a[l]);
    return cross(a[l+1] - a[l], v - a[l]) >= 0;
}

int main() {
//	freopen("data.in", "r", stdin);
//	freopen("E.out", "w", stdout);
//	freopen("newdata", "r", stdin);
    n = 0;
    o = Point(0, 0);
    for (int i = 0; i < 3; ++i) {
        scanf("%d", &sz[i]);
        for (int j = 0; j < sz[i]; ++j)
            scanf("%I64d %I64d", &p[i][j].x, &p[i][j].y);
        p[i][ sz[i] ] = p[i][0];
        for (int j = 0; j < sz[i]; ++j)
            b[n++] = v[i][j] = p[i][j+1] - p[i][j];
        st[i] = 0;
        for (int j = 1; j < sz[i]; ++j)
            if (p[i][j] < p[i][ st[i] ])
                st[i] = j;
        o = o + p[i][ st[i] ];
    }
    /*
    sort(b, b + n, cmp);
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];*/

    a[0] = Point(0, 0);
    for (int cc = 0; cc < n; ++cc) {
        int k = -1;
        for (int i = 0; i < 3; ++i)
        	if (0 == cc) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	} else if (cross(a[cc] - a[cc-1], v[i][ st[i] ]) >= 0) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	}
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }
    /*
    printf("o %lld, %lld\n", o.x, o.y);
    for (int i = 0; i <= n; ++i)
    	printf(" %lld, %lld\n", a[i].x, a[i].y);*/
    /*
    for (int cc = 0; cc < n; ++cc) {
        int k = 0;
        for (int i = 1; i < 3; ++i)
        	if (cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        		k = i;
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }*/
    int m;
    scanf("%d", &m);
    while (m--) {
        Point v;
        scanf("%I64d %I64d", &v.x, &v.y);
        v.x *= 3; v.y *= 3;
        puts( gao(v) ? "YES" : "NO" );
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 400010
#define ep 1e-10
#define INF 2e9

typedef long long LL;

const int pi = acos(-1);

struct pnt {
	int x, y;
	pnt (int x = 0, int y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(int a) {return pnt(x / a, y / a);}
	pnt operator *(int a) {return pnt(x * a, y * a);}
	LL operator ^ (pnt a) {return 1LL * x * a.y - 1LL * y * a.x;}
	LL operator & (pnt a) {return 1LL * x * a.x + 1LL * y * a.y;}
	double dist() {return sqrt(1LL * x * x + 1LL * y * y);}
	void input() {scanf("%d %d", &x, &y);}
	void print() {printf("%d %d\n", x, y);}
} vec[M], p[M], tmp[M];

int n, un, dn, up[M], down[M];
int st, en;

void init() {
	int m = 0;
	tmp[m++] = p[0], tmp[m++] = p[1];
	for (int i = 2; i < n; i++) {
		if (!(p[i] - tmp[m - 2] ^ tmp[m - 1] - tmp[m - 2])) m--;
		tmp[m++] = p[i];
	}
	if (!(tmp[m-1] - tmp[0] ^ tmp[m-1] - tmp[m-2])) m--;
	n = m;
	for (int i = 0; i < n; i++) p[i] = tmp[i];

	int minx = INF, maxx = -INF;

	for (int i = 0; i < n; i++) {
		if (p[i].x < minx) minx = p[i].x, st = i;
		if (p[i].x > maxx) maxx = p[i].x, en = i;
		p[i+n] = p[i];
	}

	if (st < en) {
		for (int i = st; i <= en; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st + n; i++) up[un++] = p[i].x;
	}
	else {
		for (int i = st; i <= en + n; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st; i++) up[un++] = p[i].x;
	}
	reverse(up, up + un);
}

bool Up(pnt a, pnt b, pnt c, int bf) {
	if (a.x == b.x) {
		return (c.y >= max(b.y, a.y) + bf);
	}
	LL A = b.y - a.y, B = a.x - b.x;
	LL C = -A * a.x - B * a.y;
	LL v = A * c.x + B * c.y + C;
	if (B <= 0) return v <= -bf;
	else return (v >= bf);
}

bool inside(pnt a, pnt b, pnt c) {
	return fabs((c - a).dist() + (c - b).dist() - (a - b).dist()) < ep;
}

bool check(int x, int y) {
	int i = lower_bound(down, down + dn, x) - down;
	if ((!i && x < down[i]) || i == dn) return 0;
	if (!i) i++;
	if (!inside(p[st+i], p[st+i-1], pnt(x, y))) {
		if (!Up(p[(st+i)], p[(st+i-1)], pnt(x, y), 0)) return 0;
	}
	else return 1;

	i = lower_bound(up, up + un, x) - up;
	if ((!i && x < up[i]) || i == un) return 0;
	if (!i) i++;
	if (!inside(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y))) {
		if (Up(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y), 1)) return 0;
	}
	return 1;
}

bool cmp(pnt a, pnt b) {
	double x = atan2(a.y, a.x), y = atan2(b.y, b.x);
	if (x < -ep) x += 2 * pi; if (y < -ep) y += 2 * pi;
	return x < y;
}

int main() {
	//freopen("E.in", "r", stdin);
	int sx = 0, sy = 0, T, x, y;
	for (int i = 0; i < 3; i++) {
		int minx = INF, miny = INF, m;
		scanf("%d", &m);
		for (int j = 0; j < m; j++) {
			p[j].input();
			if (p[j].y < miny) miny = p[j].y, minx = p[j].x;
			else if (p[j].y == miny && minx > p[j].x) minx = p[j].x;
		}
		p[m] = p[0];
		for (int j = 0; j < m; j++) {
			vec[n++] = p[j+1] - p[j];
		}
		sx += minx, sy += miny;
	}
	sort(vec, vec + n, cmp);
	p[0] = pnt(sx, sy);
	for (int i = 1; i < n; i++) p[i] = p[i-1] + vec[i-1];
	init();
	if (p[en].x == p[(en-1+n)].x) en--;
	if (p[st].x == p[(st-1+n)].x) st--;
	for (scanf("%d", &T); T--; ) {
		scanf("%d %d", &x, &y); x *= 3, y *= 3;
		if (check(x, y)) puts("YES");
		else puts("NO");
	}
}

/*
 * in the name of god
 *
 *
 *
 *
 *
 *
 *
 */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <complex>
#include <stack>
#include <deque>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef complex<double> point;
typedef long double ldb;

const int MAXN = 400000+10;
const double eps = 1e-9;

int n,que;
int x[MAXN],y[MAXN];
double val[MAXN];
point O;
vector <int> perm;
vector <point> convex,store;

double dot   (const point &A, const point &B) { return real(conj(A)*B); }
double cross (const point &A, const point &B) { return imag(conj(A)*B); }

bool cmp (const int &A, const int &B){
	return val[A]<val[B];
}

bool inside (const point &A){
	if (abs(A-O)<eps)
		return true;
	if (A.real()+eps<O.real())
		return false;
	if (A.real()<O.real()+eps && A.imag()<O.imag())
		return false;
	if (cross(convex[1]-O,A-O)<-eps)
		return false;
	if (cross(convex.back()-O,A-O)>eps)
		return false;
	int lo=1,hi=(int)convex.size()-2,ans=-1;
	while (lo<=hi){
		int mid = (lo+hi)/2;
		if (cross(convex[mid]-O,A-O)>-eps){
			ans = mid;
			lo = mid+1;
		}
		else
			hi = mid-1;
	}
	if (ans==-1)
		return false;
	return cross(convex[ans]-A,convex[ans+1]-A)>-eps;
}

int main(){
	for (int rep=1; rep<=3; rep++){
		scanf("%d",&n);
		pii mini = pii(1<<30,1<<30);
		for (int i=0; i<n; i++){
			scanf("%d%d", &x[i], &y[i]);
			mini = min(mini,pii(x[i],y[i]));
		}
		for (int i=0; i<n; i++)
			store.push_back(point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]));
		O.real()+= mini.first;
		O.imag()+= mini.second;
	}
	for (int i=0; i<(int)store.size(); i++){
		perm.push_back(i);
		val[i] = arg(store[i]);
		if (val[i]<0) val[i]+= 2*M_PI;
	}
	sort(perm.begin(),perm.end(),cmp);
	point cur = point(0,0);
	convex.push_back(cur);
	point cent = cur;
	for (int i=0; i<(int)perm.size(); i++){
		cur+= store[perm[i]];
		convex.push_back(cur);
		if (cur.real()+eps<cent.real())
			cent = cur;
		else if (cur.real()<cent.real()+eps && cur.imag()<cent.imag())
			cent = cur;
	}
	convex.pop_back();
	int posC = 0;
	for (int i=0; i<(int)convex.size(); i++){
		convex[i] = convex[i] - cent + O;
		if (abs(convex[i]-O)<eps)
			posC = i;
	}
	for (int i=0; i<posC; i++)
		convex.push_back(convex[i]);
	for (int i=posC; i<(int)convex.size(); i++)
		swap(convex[i],convex[i-posC]);
	convex.resize((int)convex.size()-posC);

	scanf ("%d", &que);
	for (int o=1; o<=que; o++){
		int X,Y; scanf("%d%d", &X, &Y);
		puts(inside(3.0*point(X,Y)) ? "YES" : "NO");
	}
	return 0;
}

#include <cmath>
#include <cstdio>
#include <algorithm>

#define cp const ww&
#define For(i,l,r) for(int i=l,_r=r;i<=_r;++i)
#define rep(i,l,r) for(int i=l,_r=r;i<_r;++i)
#define dto(i,r,l) for(int i=r,_l=l;i>=_l;--i)

using namespace std;

typedef long double db;

int Tc,gg;

struct ww{
	db x,y;
	void IN(){
		double xx,yy;
		scanf("%lf%lf",&xx,&yy);x=xx;y=yy;
	}
	ww operator + (cp A)const{return (ww){x+A.x,y+A.y};}
	ww operator - (cp A)const{return (ww){x-A.x,y-A.y};}
	db operator * (cp A)const{return x*A.x+y*A.y;}
	db operator ^ (cp A)const{return x*A.y-y*A.x;}
	ww operator * (db k)const{return (ww){x*k,y*k};}
	bool operator == (cp A)const{return fabs(x-A.x)<1e-14 && fabs(y-A.y)<1e-14;}
	bool operator < (cp A)const{
		return fabs(x-A.x)<1e-14?fabs(y-A.y)<1e-14?0:y<A.y:x<A.x;
	}
}g[4400005];

inline bool neg(db x){
	if(fabs(x)<1e-14)return 0;
	return x<0;
}

struct Poly{
	int n,m;
	ww p[1100005];
	void IN(){
		scanf("%d",&n);
		For(i,1,n)p[i].IN();
	}
	void operator += (const Poly&A){
		gg=0;
		int j=1;db mi=1e30;
		For(i,1,A.n){
			db tmp=(p[1]-A.p[i])^(p[2]-A.p[i]);
			if(tmp<=mi)mi=tmp,j=i;
		}
		For(i,1,n){
			for(;((p[i]-A.p[j])^(p[i%n+1]-A.p[j]))>=((p[i]-A.p[j%A.n+1])^(p[i%n+1]-A.p[j%A.n+1]));j=j%A.n+1);
			g[++gg]=p[i]+A.p[j];
			g[++gg]=p[i%n+1]+A.p[j];
		}
		j=1;mi=1e30;
		For(i,1,n){
			db tmp=(A.p[1]-p[i])^(A.p[2]-p[i]);
			if(tmp<=mi)mi=tmp,j=i;
		}
		For(i,1,A.n){
			for(;((A.p[i]-p[j])^(A.p[i%A.n+1]-p[j]))>=((A.p[i]-p[j%n+1])^(A.p[i%A.n+1]-p[j%n+1]));j=j%n+1);
			g[++gg]=A.p[i]+p[j];
			g[++gg]=A.p[i%A.n+1]+p[j];
		}
		sort(g+1,g+gg+1);
		gg=unique(g+1,g+gg+1)-g-1;
		n=0;
		For(i,1,gg){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		dto(i,gg,1){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		--n;
	}
	void semi(){
		For(i,1,n)p[i]=p[i]*(1./3);
		For(i,2,n)if(p[i].x<=p[i-1].x){m=i-1;break;}
		p[++n]=p[1];
	}
	bool Incl(cp P){
		if(P==p[1] || P==p[m])return 1;
		if(P.x<=p[1].x)return 0;
		if(P.x>=p[m].x)return 0;
		int i=lower_bound(p+1,p+m+1,P)-p;
		if(neg((p[i]-p[i-1])^(P-p[i-1])))return 0;
		int ll=m,rr=n+1;
		for(;ll+1<rr;){
			int mm=ll+rr>>1;
			if(p[mm].x>=P.x)ll=mm;else rr=mm;
		}
		return !neg((p[ll+1]-p[ll])^(P-p[ll]));
	}
}PolA,PolB,PolC;

int main(){
	PolA.IN();
	PolB.IN();
	PolC.IN();
	PolA+=PolB;
	PolA+=PolC;
	PolA.semi();
	for(scanf("%d",&Tc);Tc--;){
		ww P;P.IN();
		puts(PolA.Incl(P)?"YES":"NO");
	}
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define double long double

using namespace std;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(pt A, pt B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(pt A, pt B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(pt A, double z)
{
    return pt(A.x * z, A.y * z);
}

double dot(pt A, pt B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(pt A, pt B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}

double polar(pt A, pt O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(pt A, pt B, pt C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(pt X, pt B, pt C, pt D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool comp(pt A, pt B)
{
    return polar(A, pt(0, 0)) < polar(B, pt(0, 0));
}

void minco(vector <pt> A, vector <pt> B, vector <pt> & azaz)
{
    vector <pt> C, D;
    pt E = A[0], F = B[0];

    for (int i = 0; i < int(A.size()); i++)
    {
        C.push_back(A[(i + 1) % int(A.size())] - A[i]);

        if (E.y > A[i].y)
            E = A[i];
    }

    for (int i = 0; i < int(B.size()); i++)
    {
        D.push_back(B[(i + 1) % int(B.size())] - B[i]);

        if (F.y > B[i].y)
            F = B[i];
    }
    sort(C.begin(), C.end(), comp);
    sort(D.begin(), D.end(), comp);
    vector <pt> res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin(), comp);
    vector <pt> out;
    out.push_back(E + F);

    for (int i = 0; i < int(res.size()) - 1; i++)
        out.push_back(out.back() + res[i]);

    for (int i = 0; i < int(out.size()); i++)
    {
        if (!inside(out[(i - 1 + int(out.size())) % int(out.size())], out[(i + 1) % int(out.size())], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <vector <pt> > X(3, vector <pt>());

    for (int i = 0; i < 3; i++)
    {
        int n;
        cin >> n;
        X[i].resize(n);

        for (int j = 0; j < n; j++)
            cin >> X[i][j];
    }
    vector <pt> A, B;
    minco(X[0], X[1], B);
    minco(B, X[2], A);

    int n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

struct Point{
	ll x, y;
	Point(){}
	Point(ll ix, ll iy){
		x = ix; y = iy;
	}
	Point operator+(Point a){
		return Point(x + a.x, y + a.y);
	}
	Point operator-(Point a){
		return Point(x - a.x, y - a.y);
	}
};

inline ll cross(Point a, Point b){
	return a.x*b.y - a.y*b.x;
}

inline bool compare(Point a, Point b){
	int A = ((a.y > 0) || (a.x > 0))?0:1;
	int B = ((b.y > 0) || (b.x > 0))?0:1;
	if(A == B)return cross(a, b) > 0;
	return A < B;
}

inline vector<Point> combine(vector<Point> a, vector<Point> b){
	vector<Point> ret;
	ret.push_back(a[0] + b[0]);
	a.push_back(a[0]);
	b.push_back(b[0]);
	int sza = a.size();
	int szb = b.size();
	int i = 1, j = 1;
	while(i < sza || j < szb){
		if(i == sza){
			ret.push_back(ret.back() + b[j] - b[j - 1]);
			j++;
		}else if(j == szb){
			ret.push_back(ret.back() + a[i] - a[i - 1]);
			i++;
		}else{
			if(compare(a[i] - a[i - 1], b[j] - b[j - 1])){
				ret.push_back(ret.back() + a[i] - a[i - 1]);
				i++;
			}else{
				ret.push_back(ret.back() + b[j] - b[j - 1]);
				j++;
			}
		}
	}
	ret.pop_back();
	return ret;
}

inline int sign(ll x){
	if(x == 0)return x;
	if(x > 0)return 1;
	return -1;
}

inline bool isInside(Point a, Point b, Point c, Point pt){
	int A = sign(cross(a - pt, b - pt));
	int B = sign(cross(b - pt, c - pt));
	int C = sign(cross(c - pt, a - pt));
	return (A == 0 || B == 0 || C == 0) || (A == B && B == C);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<setprecision(32);

	vector<Point> a[3];
	for(int i = 0; i < 3; i++){
		int n; cin>>n;
		a[i].resize(n);
		for(auto &x : a[i]){
			cin>>x.x>>x.y;
		}
		int ind = 0;
		for(int j = 1; j < n; j++){
			if(a[i][j].x < a[i][ind].x)ind = j;
			else if(a[i][j].x == a[i][ind].x && a[i][j].y < a[i][ind].y)ind = j;
		}
		rotate(a[i].begin(), a[i].begin() + ind, a[i].end());
	}
	vector<Point> hull = combine(a[0], combine(a[1], a[2]));
	// for(auto x : hull){
	// 	cout<<x.x<<" "<<x.y<<endl;
	// }
	hull.pop_back();
	int sz = hull.size();
	int m; cin>>m;
	while(m--){
		ll x, y; cin>>x>>y;
		Point pt(3*x, 3*y);
		int lo = 1, hi = sz - 1;
		while(lo < hi){
			int mi = lo + (hi - lo + 1)/2;
			if(compare(hull[mi] - hull[0], pt - hull[0]))lo = mi;
			else hi = mi - 1;
		}
		if(lo == sz - 1){
			cout<<"NO\n";
		}else{
			if(isInside(hull[lo], hull[lo + 1], hull[0], pt)){
				cout<<"YES\n";
			}else{
				cout<<"NO\n";
			}
		}
	}

	return 0;
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define ler freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
#define MAXN 101010
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

int cmp(ll x, ll y = 0) {
	return (x <= y) ? (x < y) ? -1 : 0 : 1; }
struct point{
	ll x, y;
	point():x(0),y(0){}
	point(ll X, ll Y):x(X),y(Y){}
	int cmp(point a){
        if(::cmp(x,a.x))
            return ::cmp(x,a.x);
        return ::cmp(y,a.y);
    }
    point operator+(point a){ return point(x+a.x, y+a.y); }
    point operator-(point a){ return point(x-a.x, y-a.y); }
    point operator*(ll a){ return point(x*a,y*a); }
    ll operator*(point a){ return x*a.x + y*a.y; }
    ll operator%(point a){ return x*a.y - y*a.x; }
    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;

typedef vector<point> polygon;
point pivot;
bool radialcomp(point p, point q){
	point P = p-pivot, Q = q-pivot;
	ll R = P%Q;
	if(cmp(R)) return R > 0;
	return cmp(P*P,Q*Q) < 0;
}

polygon poly_sum(polygon a, polygon b){
	if(!sz(a) || !sz(b)) return polygon(0);
	pivot = *min_element(all(a));
	sort(all(a),radialcomp);
	pivot = *min_element(all(b));
	sort(all(b),radialcomp);
	polygon ret;
	ret.pb(a[0]+b[0]);
	int pa = 0, pb = 0;
	while(pa < sz(a) || pb < sz(b)){
		if(pb == sz(b) || (pa < sz(a) && cmp((a[(pa+1)%sz(a)]-a[pa])%(b[(pb+1)%sz(b)]-b[pb])) > 0)){
			ret.pb(ret.back() + a[(pa+1)%sz(a)] - a[pa]);
			pa++;
		}else{
			ret.pb(ret.back() + b[(pb+1)%sz(b)] - b[pb]);
			pb++;
		}
	}
	assert(ret.back() == ret[0]);
	if(sz(ret) > 1) ret.pop_back();
	return ret;
}

bool inside(point& a, point& b, point& c, point& p){
	vector<point>v;
	v.pb(a);v.pb(b);v.pb(c);v.pb(a);
	int t = 0;
	rep(i,0,3){
		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(){
	rep(k,0,3){
		point aux(2e9,2e9);
		int N, ini=-1;
		vector<point>vet;
		scanf("%d", &N);
		rep(i,0,N){
			int x, y;
			scanf("%d%d", &x, &y);
			vet.pb(point(x,y));
			if(point(x,y) < aux) aux.x=x, aux.y=y, ini=i;
		}
		rep(i,0,N) v[k].pb(vet[(i+ini)%N]);
	}
	sum = poly_sum(v[0],poly_sum(v[1],v[2]));
	n = sz(sum);
	scanf("%d", &m);
	rep(i,0,m){
		int x, y;
		scanf("%d%d", &x, &y);
		x += x+x, y += y+y;
		point p(x,y);
		if(p < sum[0]){ puts("NO"); continue; }
		if(p.x == sum[0].x){
			if(p==sum[0] || (sum.back().x==p.x && 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");
	}
}

#include <bits/stdc++.h>

#define pii pair<int, int>
#define endl "\n"
#define int long long
#define F first
#define S second
#define B begin
#define E end
#define RB rbegin
#define RE rend

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int INF = 1e9 + 1;
const double EPS = 1e-10;
const ll P = 1e9 + 7;
const int Q = 47;

using namespace std;

void hello()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}

void show(vector<int>& arr)
{
    for (auto i : arr)
        cout << i << " ";
    cout << endl;
}
void show(vector<vector<int>>& arr)
{
    for (auto i : arr)
        show(i);
    cout << endl;
}

struct pt
{
    int x, y;
    pt(){}
    pt(int tx, int ty){ x = tx; y = ty; }
    pt operator+(pt t){ return {x + t.x, y + t.y}; }
    pt operator-(pt t){ return {x - t.x, y - t.y}; }
    int operator%(pt t){ return x * t.x + y * t.y; }
    int operator*(pt t){ return x * t.y - y * t.x; }
    int len(){ return x * x + y * y; }
};

int find_min(vector <pt>& matr)
{
    int res = 0;
    for (int i = 1; i < matr.size(); ++i)
        if (matr[res].x > matr[i].x || matr[res].x == matr[i].x && matr[res].y > matr[i].y)
            res = i;
    return res;
}

bool cmp(pt l, pt r)
{
    return l * r > 0 || l * r == 0 && l.len() < r.len();
}

vector <pt> minc_sum(vector <pt> left, vector <pt> right)
{
    int indl = find_min(left);
    int indr = find_min(right);
    vector <pt> res;
    res.push_back(left[indl] + right[indr]);
    int ptl = indl;
    int ptr = indr;
    do
    {
        if (cmp(left[(indl + 1) % left.size()] - left[indl], right[(indr + 1) % right.size()] - right[indr]))
            ++indl;
        else
            ++indr;
        indl %= left.size();
        indr %= right.size();
        res.push_back(left[indl] + right[indr]);
    } while (ptl != indl || ptr != indr);
    res.pop_back();
    return res;
}

int sign(int a)
{
    if (!a)
        return 0;
    return a / abs(a);
}

bool inangle(pt o, pt a, pt b, pt x)
{
    if (sign((a - o) * (x - o)) && sign((b - o) * (x - o)))
        return sign((a - o) * (x - o)) == sign((x - o) * (b - o)) && sign((a - o) * (x - o)) == sign((a - o) * (b - o));
    if (!sign((a - o) * (x - o)) && !sign((b - o) * (x - o)))
        return (a - o) % (x - o) >= 0 || (b - o) % (x - o) >= 0;
    if (!sign((a - o) * (x - o)))
        return (a - o) % (x - o) >= 0;
    return (b - o) % (x - o) >= 0;
}

bool intrg(pt a, pt b, pt c, pt x)
{
    return inangle(a, b, c, x) && inangle(b, a, c, x);
}

signed main()
{
    hello();

    int n, m, k;
    cin >> n;
    vector <pt> v1(n);
    for (int i = 0; i < n; ++i)
        cin >> v1[i].x >> v1[i].y;
    cin >> m;
    vector <pt> v2(m);
    for (int i = 0; i < m; ++i)
        cin >> v2[i].x >> v2[i].y;
    cin >> k;
    vector <pt> v3(k);
    for (int i = 0; i < k; ++i)
        cin >> v3[i].x >> v3[i].y;

    vector <pt> matr = minc_sum(v1, v2);
    matr = minc_sum(matr, v3);

    pt dt = matr[find_min(matr)];
    for (auto& val : matr)
        val = val - dt;
    sort(matr.B(), matr.E(), cmp);
    int q;
    cin >> q;

    for (int v = 0; v < q; ++v)
    {
        pt check;
        cin >> check.x >> check.y;
        check.x *= 3;
        check.y *= 3;
        if (check.x < dt.x || check.x == dt.x && check.y < dt.y)
        {
            cout << "NO" << endl;
            continue;
        }
        if (check.x == dt.x && check.y == dt.y)
        {
            cout << "YES" << endl;
            continue;
        }
        check = check - dt;
        int ind = lower_bound(matr.B(), matr.E(), check, cmp) - matr.B();
        if (ind == matr.size())
        {
            cout << "NO" << endl;
            continue;
        }
        if (intrg(matr[0], matr[ind], matr[ind - 1], check))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;

    }

}

#pragma comment(linker, "/STACK:65777216")

#include <algorithm>
#include <iostream>
#include <string>
#include<sstream>
#include<string.h>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include<stack>
#include <set>
#include <map>
#include<ctime>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef unsigned long long ull;

#define FOR(i,a,b) for (int i(a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define SORT(v) sort((v).begin(),(v).end())
#define UN(v) sort((v).begin(),(v).end()),v.erase(unique(v.begin(),v.end()),v.end())
#define CL(a,b) memset(a,b,sizeof(a))
#define pb push_back

int n;
int m;
int x[222222];
int y[222222];
int X[211111];
int Y[211111];
int xt[222222];
int yt[222222];
double mn[111111];
double MX[111111];

void change(int *x,int *y,int n){
	int pos = 0;
	REP(i,n)if(x[i] < x[pos] || x[i] == x[pos] && y[i] > y[pos])
		pos = i;
	REP(i,n) xt[i] = x[(i+pos)%n],yt[i]=y[(i+pos)%n];
	REP(i,n) x[i] =xt[i], y[i]=yt[i];
}

bool better(ll x,ll y,ll x1,ll y1,ll x2,ll y2){
	ll q = (x1-x)*(y2-y)-(x2-x)*(y1-y);
	if(q) return q<0;
	return (x-x1)*(x-x1)+(y-y1)*(y-y1) > (y-y2)*(y-y2)+(x-x2)*(x-x2);
}

void un(){
	int N=0;

	x[n] = x[0],y[n] = y[0];
	X[m] = X[0],Y[m] = Y[0];

	int p1 = 0;
	int p2 = 0;

	while(1){
		xt[N] = x[p1] + X[p2];
		yt[N] = y[p1] + Y[p2];
		N++;
		if(N == n + m) break;

		int x1 = x[p1] + X[p2+1];
		int y1 = y[p1] + Y[p2+1];
		int x2 = x[p1+1] + X[p2];
		int y2 = y[p1+1] + Y[p2];

		if(better(xt[N-1],yt[N-1],x1,y1,x2,y2)) p2++;
		else p1++;
	}

	REP(i,N) x[i]=xt[i],y[i]=yt[i];
	n=N;

	/*puts("begin");
	REP(i,N) {
		cout<<x[i]<<' '<<y[i]<<endl;
	}
	puts("end");*/
}

typedef pair<pii,int> p3;
p3 p[111111];

const double eps = 1e-9;

int main(){
#ifdef LocalHost
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
#endif

	cin>>n;
	REP(j,n) scanf("%d %d",&x[j],&y[j]);
	reverse(x,x+n);
	reverse(y,y+n);
	change(x,y,n);
	REP(i,2){
		cin>>m;
		REP(j,m) scanf("%d %d",&X[j],&Y[j]);
		reverse(X,X+m);
		reverse(Y,Y+m);
		change(X,Y,m);
		un();
	}
	cin>>m;
	REP(i,m){
		scanf("%d %d",X+i,Y+i);
		p[i] = p3(pii(3*X[i],Y[i]),i);
		mn[i] = 1e100;
		MX[i] = -1e100;
	}
	sort(p,p+m);
	x[n] = x[0], y[0] = y[n];
	REP(i,n){
		int xf = min(x[i],x[i+1]);
		int xe = max(x[i],x[i+1]);
		int pos = lower_bound(p,p+m,p3(pii(xf,-2000000000),0))-p;
		while(pos<m){
			if(p[pos].first.first > xe) break;
			int ver = p[pos].second;
			if(xf == xe){
				mn[ver] =  min(mn[ver], 0.+min(y[i],y[i+1]));
				MX[ver] =  max(MX[ver], 0.+max(y[i],y[i+1]));
			}else{
				double Y = y[i] + (y[i+1]-y[i])*double(p[pos].first.first - x[i])/double(x[i+1]-x[i]);
				mn[ver] =  min(mn[ver], Y);
				MX[ver] =  max(MX[ver], Y);
			}

			pos++;
		}
	}
	REP(i,m){
		puts(3*Y[i]>=mn[i]-eps && 3*Y[i]<=MX[i]+eps ? "YES":"NO");
		//cout<<
	}

#ifdef LocalHost
	cout<<endl<<endl<<"TIME: "<<clock()<<endl;
#endif
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int Maxd = 3;
const ll Inf = 4000000000000000000ll;

struct pt{
    long long x, y;
    pt operator + (const pt & p) const {
        return pt{x + p.x, y + p.y};
    }
    pt operator - (const pt & p) const {
        return pt{x - p.x, y - p.y};
    }
    long long cross(const pt & p) const {
        return x * p.y - y * p.x;
    }
    bool operator <(const pt &oth) const {
        if (x != oth.x) return x < oth.x;
        return y < oth.y;
    }
};

vector <pt> seq[Maxd];
ll mn = Inf, mx = Inf;
map <pt, pt> Mlow, Mupp;

void reorder_polygon(vector<pt> & P){
    size_t pos = 0;
    for(size_t i = 1; i < P.size(); i++){
        if(P[i].y < P[pos].y || (P[i].y == P[pos].y && P[i].x < P[pos].x))
            pos = i;
    }
    rotate(P.begin(), P.begin() + pos, P.end());
}

vector<pt> minkowski(vector<pt> P, vector<pt> Q){
    // the first vertex must be the lowest
    reorder_polygon(P);
    reorder_polygon(Q);
    // we must ensure cyclic indexing
    P.push_back(P[0]);
    P.push_back(P[1]);
    Q.push_back(Q[0]);
    Q.push_back(Q[1]);
    // main part
    vector<pt> result;
    size_t i = 0, j = 0;
    while(i < P.size() - 2 || j < Q.size() - 2){
        result.push_back(P[i] + Q[j]);
        auto cross = (P[i + 1] - P[i]).cross(Q[j + 1] - Q[j]);
        if(cross >= 0)
            ++i;
        if(cross <= 0)
            ++j;
    }
    return result;
}

void Read(vector <pt> &seq)
{
    int n; scanf("%d", &n);
    seq.resize(n);
    for (int i = 0; i < n; i++)
        scanf("%I64d %I64d", &seq[i].x, &seq[i].y);
}

int main()
{
    for (int i = 0; i < Maxd; i++)
        Read(seq[i]);
    auto tmp = minkowski(minkowski(seq[0], seq[1]), seq[2]);
    for (int i = 0; i < tmp.size(); i++) {
        int ni = (i + 1) % int(tmp.size());
        mn = min(mn, tmp[i].x);
        mx = max(mx, tmp[i].x);
        if (tmp[i].x < tmp[ni].x) Mlow[{tmp[i].x, tmp[i].y}] = {tmp[ni].x - tmp[i].x, tmp[ni].y - tmp[i].y};
        else Mupp[{tmp[ni].x, tmp[ni].y}] = {tmp[i].x - tmp[ni].x, tmp[i].y - tmp[ni].y};
    }
    int m; scanf("%d", &m);
    while (m--) {
        ll x, y; scanf("%I64d %I64d", &x, &y);
        x *= 3ll; y *= 3ll;
        if (x < mn || x > mx) { printf("NO\n"); continue; }
        auto it = Mupp.lower_bound({x + 1, -Inf});
        it--;
        pt my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) < 0) { printf("NO\n"); continue; }
        it = Mlow.lower_bound({x + 1, -Inf});
        it--;
        my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) > 0) { printf("NO\n"); continue; }
        printf("YES\n");
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
struct Point
{
    long long x, y;
    Point()
    {
        x = 0;
        y = 0;
    }
    Point(int xx, int yy)
    {
        x = xx;
        y = yy;
    }
    bool operator == (Point p1)
    {
        return x == p1.x && y == p1.y;
    }
    bool operator != (Point p1)
    {
        return (x != p1.x || y != p1.y);
    }
    Point operator - (const Point p1)
    {
        return Point(x - p1.x, y - p1.y);
    }
    Point operator + (const Point p1)
    {
        return Point(x + p1.x, y + p1.y);
    }
    long long len()
    {
        return (x * x + y * y);
    }
    long long vec(Point p)
    {
        //<0 if argument Point is right
        return (x * p.y - y * p.x);
    }
    void Print()
    {
        cout << x << ' ' << y << '\n';
    }
    void Scan()
    {
        cin >> x >> y;
    }
};
Point M[4];
vector<Point> v;
vector<Point> mink;
bool cmp(Point p1, Point p2)
{
    bool val1 = p1.y > 0 || (p1.y == 0 && p1.x > 0);
    bool val2 = p2.y > 0 || (p2.y == 0 && p2.x > 0);
    if (val1 != val2)
        return val1;
    return (p1.vec(p2) > 0);
}
int main()
{
    for(int q = 1; q <= 3; q++)
    {
        int n;
        cin >> n;
        M[q] = Point(1e9, 1e9);
        vector<Point> v1;
        //vector<Point> v1;
        for(int i = 1; i <= n; i++)
        {
            int x, y;
            cin >> x >> y;
            v1.push_back(Point(x, y));
            if(y < M[q].y || (y == M[q].y && x < M[q].x))
            {
                M[q] = Point(x, y);
            }
        }
        for(int i = 0; i < (int)v1.size(); i++)
        {
            v1[i] = v1[i] - M[q];
        }
        for(int i = 0; i < n; i++)
        {
            //v[q].push_back(v1[(i + 1) % n] - v1[i]);
            mink.push_back(v1[(i + 1) % n] - v1[i]);
        }
    }
    Point T = M[1] + M[2] + M[3];
    sort(mink.begin(), mink.end(), cmp);
    v.push_back(Point(0, 0));
    for(int i = 0; i + 1 < (int)mink.size(); i++)
    {
        v.push_back(v.back() + mink[i]);
    }
    //cout << v.size()<<'!'<<endl;
    //for(auto x: v)
   // {
    //    x.Print();
    //}
    //cout << endl<<endl;
    int m;
    cin >> m;
    for(int i = 1; i <= m; i++)
    {
        Point A;
        A.Scan();
        A.x = A.x * 3;
        A.y = A.y * 3;
        A = A - T;
        if(v[1].vec(A) < 0 || v.back().vec(A) > 0)
        {
            //cout<<'!'<<endl;
            cout << "NO\n";
            continue;
        }
        int l = 0, r = v.size();
        while(r - l > 1)
        {
            int mid = (l + r) / 2;
            if(v[mid].vec(A) <= 0)
            {
                r = mid;
            }
            else
            {
                l = mid;
            }
        }
        if(r == v.size())
        {
            r--;
            l--;
        }
        if(l == 0)
        {
            r++;
            l++;
        }
        Point B = v[l];
        Point C = v[r];
        Point T = Point(0, 0);
        A = A - C;
        B = B - C;
        T = T - C;
        long long vec1 = B.vec(A);
        long long vec2 = B.vec(T);
        if(vec1 == 0)
        {
            cout << "YES\n";
            continue;
        }
        if((vec1 < 0 && vec2 < 0) || (vec1 > 0 && vec2 > 0))
        {
            cout << "YES\n";
            continue;
        }
        cout << "NO\n";
    }
    //cout<<'!'<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 50000;

struct P{
	ll x, y;
	P():x(0), y(0) {}
	P(ll a, ll b):x(a), y(b) {}
	void sc() { scanf("%lld%lld", &x, &y); }
	P operator +(P const &o)const { return P(x + o.x, y + o.y); }
	P operator -(P const &o)const { return P(x - o.x, y - o.y); }
	P operator *(int s)const { return P(x * s, y * s); }
	double ang()const { return atan2(y, x); }
	bool operator <(P const &o)const { return ang() < o.ang(); }
	ll operator |(P const &o)const { return x * o.y - y * o.x; }
}p[N], b;

vector<P> h;

void sc(){
	int n, l = h.size(), mn = 0;
	scanf("%d", &n);
	f(i, 0, n)p[i].sc();
	f(i, 1, n)if (p[i].y > p[mn].y || p[i].y == p[mn].y && p[i].x < p[mn].x)mn = i;
	f(i, mn, n)h.push_back(p[i]);
	f(i, 0, mn)h.push_back(p[i]);
	P t = p[mn];
	b = b + t;
	f(i, l, h.size() - 1)h[i] = h[i + 1] - h[i];
	h.back() = t - h.back();
	inplace_merge(h.begin(), h.begin() + l, h.end());
}

bool in(P const &o){
	int l = 0, r = h.size() - 1;
	while (r > l){
		int m = l + r + 1 >> 1;
		if ((o - h[0] | h[m] - h[0]) > 0)r = m - 1;
		else l = m;
	}
	if (l == 0 || l + 1 == h.size())return false;
	P d = h[l + 1 == h.size() ? 0 : l + 1] - h[l];
	return (d | o - h[l]) >= 0;
}

int main(){
	f(i, 0, 3)sc();
	P t = h[0];
	h[0] = b;
	f(i, 1, h.size()){
		P tt = h[i];
		h[i] = t + h[i - 1];
		t = tt;
	}
	int m;
	scanf("%d", &m);
	while (m--){
		P p;
		p.sc();
		printf("%s\n", in(p * 3) ? "YES" : "NO");
	}
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define ler freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
#define MAXN 101010
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

int cmp(ll x, ll y = 0) {
	return (x <= y) ? (x < y) ? -1 : 0 : 1; }
struct point{
	ll x, y;
	point():x(0),y(0){}
	point(ll X, ll Y):x(X),y(Y){}
	int cmp(point a){
        if(::cmp(x,a.x))
            return ::cmp(x,a.x);
        return ::cmp(y,a.y);
    }
    point operator+(point a){ return point(x+a.x, y+a.y); }
    point operator-(point a){ return point(x-a.x, y-a.y); }
    point operator*(ll a){ return point(x*a,y*a); }
    ll operator*(point a){ return x*a.x + y*a.y; }
    ll operator%(point a){ return x*a.y - y*a.x; }
    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(pair<point,int>A, pair<point,int>B){
	point a = A.x, b = B.x;
	if(a.x >= 0 && b.x < 0) return 1;
	if(a.x < 0 && b.x >= 0) return 0;
	ll 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.pb(a);v.pb(b);v.pb(c);v.pb(a);
	int t = 0;
	rep(i,0,3){
		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(){
	rep(k,0,3){
		point aux(2e9,2e9);
		int N, ini=-1;
		vector<point>vet;
		scanf("%d", &N);
		rep(i,0,N){
			int x, y;
			scanf("%d%d", &x, &y);
			vet.pb(point(x,y));
			if(point(x,y) < aux) aux.x=x, aux.y=y, ini=i;
		}
		rep(i,0,N) v[k].pb(vet[(i+ini)%N]);
		n += N;
	}
	int id[] = {0,0,0};
	sum.pb(v[0][0]+v[1][0]+v[2][0]);
	rep(tt,0,n-1){
		vector<pair<point,int> >op;
		rep(i,0,3) if(id[i] < sz(v[i]))
			op.pb(mp(v[i][(id[i]+1)%sz(v[i])]-v[i][id[i]],i));
		sort(all(op),radialcomp);
		while(sz(sum) > 1 && !ccw(sum[sz(sum)-2], sum[sz(sum)-1], op[0].x) )
			sum.pop_back();
		sum.pb(sum.back()+op[0].x);
		id[op[0].y]++;
	}
	n = sz(sum);
	scanf("%d", &m);
	rep(i,0,m){
		int x, y;
		scanf("%d%d", &x, &y);
		x += x+x, y += y+y;
		point p(x,y);
		if(p < sum[0]){ puts("NO"); continue; }
		if(p.x == sum[0].x){
			if(p==sum[0] || (sum[1].x==p.x && between(sum[0],p,sum[1]))) 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");
	}
}

// meow-meow
#pragma GCC optimize("O3", "unroll-loops")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = min((a), (b))
#define maxeq(a, b) (a) = max((a), (b))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

struct vect {
	ll x, y;
	vect() {}
	vect(ll x1, ll y1) {
		x = x1, y = y1;
	}
	vect operator + (vect &a) {
		return vect(x + a.x, y + a.y);
	}
	vect operator - (vect &a) {
		return vect(x - a.x, y - a.y);
	}
	ll operator * (vect &a) {
		return x * a.x + y * a.y;
	}
	ll operator % (vect &a) {
		return x * a.y - y * a.x;
	}
	vect operator * (ll k) {
		return vect(x*k, y*k);
	}
	vect rotate(ld a) {
		return vect(x*cos(a) - y * sin(a), x*sin(a) + y * cos(a));
	}
	bool operator == (vect a) {
		return pll(x, y) == pll(a.x, a.y);
	}
	bool operator < (vect &a) {
		return pll(y, x) < pll(a.y, a.x);
	}
};

bool comp(vect &a, vect &b) {
	if (a.y >= 0 && b.y < 0) {
		return true;
	}
	if (a.y < 0 && b.y >= 0) {
		return false;
	}
	if (a.y == 0 && b.y == 0) {
		if (a.x > 0 && b.x < 0) {
			return true;
		} else if (a.x < 0 && b.x > 0) {
			return false;
		}
	}
	ll p = a % b;
	if (p == 0) {
		return a * a < b * b;
	}
	return p > 0;
}

vector<vect> x1, x2, x3;
vector<vect> mink;
vect O;

vector<vect> get(vector<vect> &a, vector<vect> &b, vector<vect> &c) {
	vector<vect> d;

	a.pb(a[0]);
	for (ll i = 0; i < sz(a) - 1; i++) {
		d.pb(a[i + 1] - a[i]);
	}
	a.popb();
	sort(all(a));

	b.pb(b[0]);
	for (ll i = 0; i < sz(b) - 1; i++) {
		d.pb(b[i + 1] - b[i]);
	}
	b.popb();
	sort(all(b));

	c.pb(c[0]);
	for (ll i = 0; i < sz(c) - 1; i++) {
		d.pb(c[i + 1] - c[i]);
	}
	c.popb();
	sort(all(c));

	sort(all(d), comp);

	vect A = a[0] + b[0] + c[0];

	vector<vect> res;
	res.pb(A);
	res.pb(res.back() + d[0]);
	for (ll i = 1; i < sz(d); i++) {
		vect v1 = (res.back() + d[i]) - res.back();
		vect v2 = res.back() - res[sz(res) - 2];
		ll p = v1 % v2;

		res.pb(res.back() + d[i]);
	}
	return res;
}

int sign(ll a) {
	if (a > 0) {
		return 1;
	} else if (a < 0) {
		return -1;
	} else {
		return 0;
	}
}

bool check(vect P, vect A, vect B) {
	vect OP = P - O, OA = A - O, OB = B - O;
	ll p1 = OP % OA, p2 = OA % OB;
	return sign(p1) != sign(p2);
}

bool triangle(vect P, vect A, vect B, vect C) {
	vect PA = A - P, PB = B - P, PC = C - P, AB = B - A, AC = C - A;
	ull s1 = ull(abs(PA % PB)) + ull(abs(PB % PC)) + ull(abs(PC % PA));
	ull s2 = abs(AB % AC);
	return s1 == s2;
}

bool solve(vect P) {
	ll n = sz(mink);
	ll l = -1, r = n - 1;
	while (r - l > 1) {
		ll m = (l + r) / 2;
		if (check(P, mink[m], mink[m + 1])) {
			l = m;
		} else {
			r = m;
		}
	}
	if (l == -1) {
		return false;
	}
	return triangle(P, O, mink[l], mink[l + 1]);
}

void solve() {
	ll m;
	cin >> m;
	mink = get(x1, x2, x3);
	mink.popb();
	O = mink.back();
	mink.popb();
	for (ll i = 0; i < m; i++) {
		vect P;
		cin >> P.x >> P.y;
		P.x *= 3, P.y *= 3;
		bool ans = solve(P);
		if (ans) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

void change(vector<vect> &a) {
	ll n;
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i].x >> a[i].y;
	}
}

void read() {
	change(x1);
	change(x2);
	change(x3);
}

int main() {
	fast;
	read();
	solve();
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#define int long long
using namespace std;

struct pt
{
    int x, y;
    pt() {}
    pt(int x, int y): x(x), y(y) {}
} O(2e9, -1);
bool operator== (pt a, pt b) {return a.x == b.x && a.y == b.y;}
pt operator+ (pt a, pt b) {return {a.x + b.x, a.y + b.y};}
pt operator- (pt a, pt b) {return {a.x - b.x, a.y - b.y};}
int operator% (pt a, pt b) {return a.x * b.y - a.y * b.x;}
bool half(pt a) {return a.y > 0 || !a.y && a.x > 0;}
bool less_xy(pt a, pt b) {return a.y < b.y || a.y == b.y && a.x < b.x;}

bool operator< (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b > 0;
}

bool operator<= (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b >= 0;
}

vector<pt> p1, p2, p3, all;

void rotate(vector<pt>& p)
{
    int id = 0;
    for (int i = 0; i < p.size(); ++i)
        if (less_xy(p[i], p[id]))
            id = i;
    rotate(p.begin(), p.begin() + id, p.end());
    p.push_back(p[0]);
}

inline bool online(pt a, pt b, pt c) {return (b - a) % (c - b) == 0;}

void alladd(pt p)
{
    while (all.size() > 1 && online(all[all.size()-2], all[all.size()-1], p))
        all.pop_back();
    all.push_back(p);
}

void accumulate()
{
    all.push_back(p1[0] + p2[0] + p3[0]);
    for (int i = 0, j = 0, k = 0; i < p1.size() - 1 || j < p2.size() - 1 || k < p3.size() - 1;)
    {
        pt v1 = i < p1.size() - 1 ? p1[i+1] - p1[i] : O, v2 = j < p2.size() - 1 ? p2[j+1] - p2[j] : O, v3 = k < p3.size() - 1 ? p3[k+1] - p3[k] : O;
        if (v1 <= v2 && v1 <= v3)
            alladd(all.back() + v1), i++;
        else if (v2 <= v1 && v2 <= v3)
            alladd(all.back() + v2), j++;
        else if (v3 <= v1 && v3 <= v2)
            alladd(all.back() + v3), k++;
    }
    assert(all[0] == all.back());
    alladd(all[1]), all.pop_back();
}

bool in_triangle(pt p, pt a, pt b, pt c)
{
    return (b - a) % (p - a) >= 0 && (p - a) % (c - a) >= 0
        && (c - b) % (p - b) >= 0 && (p - b) % (a - b) >= 0
        && (a - c) % (p - c) >= 0 && (p - c) % (b - c) >= 0;
}

bool in_polygon(vector<pt>& v, pt p)
{
    int l = 1, r = all.size() - 1, m;
    while (r - l > 1)
    {
        m = (l + r) / 2;
        (p - all[0] < all[m] - all[0] ? r : l) = m;
    }
    return in_triangle(p, all[0], all[l], all[r]);
}

signed main()
{
    int n, m, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p1.push_back(p);
    }
    cin >> m;
    for (int i = 0; i < m; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p2.push_back(p);
    }
    cin >> k;
    for (int i = 0; i < k; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p3.push_back(p);
    }
    rotate(p1);
    rotate(p2);
    rotate(p3);
    accumulate();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        pt p;
        cin >> p.x >> p.y, p.x *= 3, p.y *= 3;
        cout << (in_polygon(all, p) ? "YES" : "NO") << '\n';
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

struct Point
{
	__int64 x, y;

	Point(int x, int y) : x(x), y(y) {}

	bool operator<(const Point &p) const
	{
		if (y != p.y) return y < p.y;
		return x < p.x;
	}

	bool operator==(const Point &p) const
	{
		return x == p.x && y == p.y;
	}

	void operator+=(const Point &p)
	{
		x += p.x;
		y += p.y;
	}
};

Point operator-(const Point &a, const Point &b)
{
	return Point(a.x - b.x, a.y - b.y);
}

bool turnRight(const Point &a, const Point &b)
{
	Point c = b - a;
	__int64 cross = a.x * b.y - a.y * b.x;
	return cross < 0;
}

struct Polygon
{
	vector<Point> p;

	void read()
	{
		int n;
		scanf("%d", &n);
		for(int i = 0; i < n; i++)
		{
			__int64 x, y;
			scanf("%I64d %I64d", &x, &y);
			p.push_back(Point(x, y));
		}
	}

	int startPoint()
	{
		int res = 0;
		for(int i = 1; i < p.size(); i++) if (p[i] < p[res]) res = i;
		return res;
	}

	int midPoint()
	{
		int res = 0;
		for(int i = 1; i < p.size(); i++) if (p[res] < p[i]) res = i;
		return res;
	}

	Point getVector(int k)
	{
		int next = k + 1;
		if (next == p.size()) next = 0;
		return p[next] - p[k];
	}
};

Polygon a[3], res;
int k[3];

int main()
{
    for(int i = 0; i < 3; i++) a[i].read();
	res.p.push_back(Point(0, 0));

	for(int i = 0; i < 3; i++)
	{
		k[i] = a[i].startPoint();
		res.p[0] += a[i].p[k[i]];
	}

	while(1)
	{
		int next = 0;
		for(int i = 1; i < 3; i++) if (turnRight(a[next].getVector(k[next]), a[i].getVector(k[i]))) next = i;

		k[next]++;
		if (k[next] == a[next].p.size()) k[next] = 0;

		res.p.push_back(Point(0, 0));

		for(int i = 0; i < 3; i++) res.p[res.p.size() - 1] += a[i].p[k[i]];

		if (res.p[res.p.size() - 1] == res.p[0]) break;
	}

	/*printf("%d\n", res.p.size());
	for(int i = 0; i < res.p.size(); i++) printf("%d %d\n", res.p[i].x, res.p[i].y);*/

	int mid = res.midPoint();

	int m;

	scanf("%d", &m);
	while(m--)
	{
		int x, y;
		scanf("%I64d %I64d", &x, &y);
		x *= 3; y *= 3;
		Point xy = Point(x, y);

		if (xy < res.p[0] || res.p[mid] < xy)
		{
			puts("NO");
			continue;
		}

		int L = 0, R = mid + 1;
		while(R - L > 1)
		{
			int cur = (L + R) / 2;
			if (res.p[cur].y <= y) L = cur; else R = cur;
		}

		if (L < mid && turnRight(res.getVector(L), xy - res.p[L]))
		{
			puts("NO");
			continue;
		}

		L = mid; R = res.p.size();
		while(R - L > 1)
		{
			int cur = (L + R) / 2;
			if (res.p[cur].y >= y) L = cur; else R = cur;
		}

		if (L < res.p.size() && turnRight(res.getVector(L), xy - res.p[L]))
		{
			puts("NO");
			continue;
		}

		puts("YES");
	}

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

struct point {
	int x, y;
	void read() {
		scanf("%d%d", &x, &y);
	}
};

int n[3], N, start[3], pos[3], p1[3], p2[3];
point a[3][500005];
point b[2000005];

int area(point a, point b, point c) {
	long long res = 0LL + (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
	if (res < 0LL) return -1;
	if (res > 0LL) return  1;
	return 0;
}

void add(point p) {
	//printf("%d %d\n", p.x, p.y);
	if (N >= 2 && area(b[N - 2], b[N - 1], p) == 0) N--;
	b[N++] = p;
}

void Construct_Minkowski_Sum() {
	int i, j, k;
	for (i = 0; i < 3; ++i) {
		int ld = 0;
		for (j = 1; j < n[i]; ++j) {
			if (a[i][j].y < a[i][ld].y || (a[i][j].y == a[i][ld].y && a[i][j].x < a[i][ld].x)) ld = j;
		}
		start[i] = ld;
	}

	while (pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]) {
		for (i = 0; i < 3; ++i) {
			p1[i] = (start[i] + pos[i]) % n[i];
			p2[i] = (p1[i] + 1) % n[i];
		}
		//printf("(%d %d) (%d %d) (%d %d)\n", a[0][p1[0]].x, a[0][p1[0]].y, a[1][p1[1]].x, a[1][p1[1]].y, a[2][p1[2]].x, a[2][p1[2]].y);
		add({a[0][p1[0]].x + a[1][p1[1]].x + a[2][p1[2]].x, a[0][p1[0]].y + a[1][p1[1]].y + a[2][p1[2]].y});

		int next = -1;
		int dx = 0, dy = 0;
		for (i = 0; i < 3; ++i) if (pos[i] < n[i]) {
			int dx2 = a[i][p2[i]].x - a[i][p1[i]].x;
			int dy2 = a[i][p2[i]].y - a[i][p1[i]].y;
			int cmp = (dy > 0 || (dy == 0 && dx > 0)) ? 0 : 1;
			int cmp2 = (dy2 > 0 || (dy2 == 0 && dx2 > 0)) ? 0 : 1;
			bool ok = false;
			if (next == -1) ok = true;
			if (cmp > cmp2) ok = true;
			if (cmp == cmp2) {
				if (0LL + dx2 * dy - dy2 * dx > 0LL) ok = true;
			}
			if (ok) {
				dx = dx2;
				dy = dy2;
				next = i;
			}
		}
		pos[next]++;
	}
}

int inprod(point a, point b, point p) {
	long long res = 0LL + (b.x - a.x) * (p.x - a.x) + (b.y - a.y) * (p.y - a.y);
	if (res > 0LL) return 1;
	if (res < 0LL) return -1;
	return 0;
}

bool on(point a, point b, point p) {
	if (area(a, b, p) != 0) return 0;
	if (inprod(a, b, p) >= 0 && inprod(b, a, p) >= 0) return 1;
	return 0;
}

bool inside(point a, point b, point c, point p) {
	if (on(a, b, p) || on(a, c, p) || on(b, c, p)) return 1;
	int x = area(a, b, p);
	int y = area(b, c, p);
	int z = area(c, a, p);
	if (x == y && y == z && x != 0) return 1;
	return 0;
}

bool Centroid(int x, int y) {
	x *= 3, y *= 3;
	point p = {x, y};
	if (area(b[0], b[1], p) < 0) return 0;
	if (area(b[0], b[N - 1], p) > 0) return 0;
	int l = 1, r = N - 1;
	while (r - l > 1) {
		int mid = (r + l) / 2;
		if (area(b[0], b[mid], p) < 0) r = mid;
		else l = mid;
	}
	return inside(b[0], b[l], b[r], p);
}

int main() {
	int i, j, k, m;
	for (i = 0; i < 3; ++i) {
		scanf("%d", &n[i]);
		for (j = 0; j < n[i]; ++j)
			a[i][j].read();
	}
	Construct_Minkowski_Sum();

	/*printf("%d\n", N);
	for (i = 0; i < N; ++i)
		printf("%d %d\n", b[i].x, b[i].y);*/

	scanf("%d", &m);
	for (i = 0; i < m; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		if (Centroid(x, y))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

struct point {
	int x, y;
	void read() {
		scanf("%d%d", &x, &y);
	}
};

int n[3], N, start[3], pos[3], p1[3], p2[3];
point a[3][500005];
point b[2000005];

int area(point a, point b, point c) {
	long long res = 0LL + (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
	if (res < 0LL) return -1;
	if (res > 0LL) return  1;
	return 0;
}

void add(point p) {
	//printf("%d %d\n", p.x, p.y);
	if (N >= 2 && area(b[N - 2], b[N - 1], p) == 0) N--;
	b[N++] = p;
}

void Construct_Minkowski_Sum() {
	int i, j, k;
	for (i = 0; i < 3; ++i) {
		int ld = 0;
		for (j = 1; j < n[i]; ++j) {
			if (a[i][j].y < a[i][ld].y || (a[i][j].y == a[i][ld].y && a[i][j].x < a[i][ld].x)) ld = j;
		}
		start[i] = ld;
	}

	while (pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]) {
		for (i = 0; i < 3; ++i) {
			p1[i] = (start[i] + pos[i]) % n[i];
			p2[i] = (p1[i] + 1) % n[i];
		}
		//printf("(%d %d) (%d %d) (%d %d)\n", a[0][p1[0]].x, a[0][p1[0]].y, a[1][p1[1]].x, a[1][p1[1]].y, a[2][p1[2]].x, a[2][p1[2]].y);
		add({a[0][p1[0]].x + a[1][p1[1]].x + a[2][p1[2]].x, a[0][p1[0]].y + a[1][p1[1]].y + a[2][p1[2]].y});

		int next = -1;
		int dx = 0, dy = 0;
		for (i = 0; i < 3; ++i) if (pos[i] < n[i]) {
			int dx2 = a[i][p2[i]].x - a[i][p1[i]].x;
			int dy2 = a[i][p2[i]].y - a[i][p1[i]].y;
			int cmp = (dy > 0 || (dy == 0 && dx > 0)) ? 0 : 1;
			int cmp2 = (dy2 > 0 || (dy2 == 0 && dx2 > 0)) ? 0 : 1;
			bool ok = false;
			if (next == -1) ok = true;
			if (cmp > cmp2) ok = true;
			if (cmp == cmp2) {
				if (0LL + dx2 * dy - dy2 * dx > 0LL) ok = true;
			}
			if (ok) {
				dx = dx2;
				dy = dy2;
				next = i;
			}
		}
		pos[next]++;
	}
}

bool Centroid(int x, int y) {
	x *= 3, y *= 3;
	point p = {x, y};
	if (area(b[0], b[1], p) < 0) return 0;
	if (area(b[0], b[N - 1], p) > 0) return 0;
	int l = 0, r = N - 1;
	while (r - l > 1) {
		int mid = (r + l) / 2;
		if (area(b[0], b[mid], p) < 0) r = mid;
		else l = mid;
	}
	if (area(b[l], b[r], p) >= 0) return 1;
	return 0;
}

int main() {
	int i, j, k, m;
	for (i = 0; i < 3; ++i) {
		scanf("%d", &n[i]);
		for (j = 0; j < n[i]; ++j)
			a[i][j].read();
	}
	Construct_Minkowski_Sum();
	if (N > 2 && area(b[N - 2], b[N - 1], b[0]) == 0) --N;

	/*printf("%d\n", N);
	for (i = 0; i < N; ++i)
		printf("%d %d\n", b[i].x, b[i].y);*/

	scanf("%d", &m);
	for (i = 0; i < m; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		if (Centroid(x, y))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

struct point {
	int x, y;
	void read() {
		scanf("%d%d", &x, &y);
	}
};

int n[3], N, start[3], pos[3], p1[3], p2[3];
point a[3][500005];
point b[2000005];

int area(point a, point b, point c) {
	long long res = 0LL + (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
	if (res < 0LL) return -1;
	if (res > 0LL) return  1;
	return 0;
}

void add(point p) {
	//printf("%d %d\n", p.x, p.y);
	if (N >= 2 && area(b[N - 2], b[N - 1], p) == 0) N--;
	b[N++] = p;
}

void Construct_Minkowski_Sum() {
	int i, j, k;
	for (i = 0; i < 3; ++i) {
		int ld = 0;
		for (j = 1; j < n[i]; ++j) {
			if (a[i][j].y < a[i][ld].y || (a[i][j].y == a[i][ld].y && a[i][j].x < a[i][ld].x)) ld = j;
		}
		start[i] = ld;
	}

	while (pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]) {
		for (i = 0; i < 3; ++i) {
			p1[i] = (start[i] + pos[i]) % n[i];
			p2[i] = (p1[i] + 1) % n[i];
		}
		//printf("(%d %d) (%d %d) (%d %d)\n", a[0][p1[0]].x, a[0][p1[0]].y, a[1][p1[1]].x, a[1][p1[1]].y, a[2][p1[2]].x, a[2][p1[2]].y);
		add({a[0][p1[0]].x + a[1][p1[1]].x + a[2][p1[2]].x, a[0][p1[0]].y + a[1][p1[1]].y + a[2][p1[2]].y});

		int next = -1;
		int dx = 0, dy = 0;
		for (i = 0; i < 3; ++i) if (pos[i] < n[i]) {
			int dx2 = a[i][p2[i]].x - a[i][p1[i]].x;
			int dy2 = a[i][p2[i]].y - a[i][p1[i]].y;
			int cmp = (dy > 0 || (dy == 0 && dx > 0)) ? 0 : 1;
			int cmp2 = (dy2 > 0 || (dy2 == 0 && dx2 > 0)) ? 0 : 1;
			bool ok = false;
			if (next == -1) ok = true;
			if (cmp > cmp2) ok = true;
			if (cmp == cmp2) {
				if (0LL + dx2 * dy - dy2 * dx > 0LL) ok = true;
			}
			if (ok) {
				dx = dx2;
				dy = dy2;
				next = i;
			}
		}
		pos[next]++;
	}
}

int inprod(point a, point b, point p) {
	long long res = 0LL + (b.x - a.x) * (p.x - a.x) + (b.y - a.y) * (p.y - a.y);
	if (res > 0LL) return 1;
	if (res < 0LL) return -1;
	return 0;
}

bool on(point a, point b, point p) {
	if (inprod(a, b, p) >= 0 && inprod(b, a, p) >= 0) return 1;
	return 0;
}

bool inside(point a, point b, point c, point p) {
	if (on(a, b, p) || on(a, c, p) || on(b, c, p)) return 1;
	int x = area(a, b, p);
	int y = area(b, c, p);
	int z = area(c, a, p);
	if (x == y && y == z && x != 0) return 1;
	return 0;
}

bool Centroid(int x, int y) {
	x *= 3, y *= 3;
	point p = {x, y};
	if (area(b[0], b[1], p) < 0) return 0;
	if (area(b[0], b[N - 1], p) > 0) return 0;
	int l = 1, r = N - 1;
	while (r - l > 1) {
		int mid = (r + l) / 2;
		if (area(b[0], b[mid], p) < 0) r = mid;
		else l = mid;
	}
	return inside(b[0], b[l], b[r], p);
}

int main() {
	int i, j, k, m;
	for (i = 0; i < 3; ++i) {
		scanf("%d", &n[i]);
		for (j = 0; j < n[i]; ++j)
			a[i][j].read();
	}
	Construct_Minkowski_Sum();

	/*printf("%d\n", N);
	for (i = 0; i < N; ++i)
		printf("%d %d\n", b[i].x, b[i].y);*/

	scanf("%d", &m);
	for (i = 0; i < m; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		if (Centroid(x, y))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define point pair<int,int>
using namespace std;

long long crossProduct(point A,point B,point C)
{
    int ax = B.first - A.first,ay = B.second - A.second;
    int bx = C.first - B.first,by = C.second - B.second;
    return 1LL * ax * by - 1LL * ay * bx;
}

int ccw(point A,point B,point C)
{
    long long tmp = crossProduct(A,B,C);
    if (tmp > 0) return 1; else if (tmp < 0) return -1; else return 0;
}

point sum(point A,point B)
{
    return make_pair(A.first + B.first,A.second + B.second);
}

struct polygon
{
    vector< point > vertices,leftBorder,rightBorder;

    void loadPolygon()
    {
        int n;
        scanf("%d", &n);
        vertices.resize(n);
        for (int i = 0; i < n; i++) scanf("%d %d", &vertices[i].first, &vertices[i].second);
    }

    void prepareBorder()
    {
        int miny = vertices[0].second,maxy = vertices[0].second;
        for (int i = 1; i < vertices.size(); i++)
        {
            miny = min(miny,vertices[i].second);
            maxy = max(maxy,vertices[i].second);
        }

        int rightStart;
        for (rightStart = 0; rightStart < vertices.size(); rightStart++)
          if (vertices[rightStart].second == miny && vertices[(rightStart + 1) % vertices.size()].second > miny) break;
        for (int i = rightStart; ; i = (i + 1) % vertices.size())
        {
            rightBorder.push_back(vertices[i]);
            if (vertices[i].second == maxy) break;
        }

//        for (int i = 0; i < rightBorder.size(); i++) cout << rightBorder[i].first << ' ' << rightBorder[i].second << endl;
//        cout << endl;

        int leftStart;
        for (leftStart = 0; leftStart < vertices.size(); leftStart++)
          if (vertices[leftStart].second == maxy && vertices[(leftStart + 1) % vertices.size()].second < maxy) break;
        for (int i = leftStart; ; i = (i + 1) % vertices.size())
        {
            leftBorder.push_back(vertices[i]);
            if (vertices[i].second == miny) break;
        }

//        for (int i = 0; i < leftBorder.size(); i++) cout << leftBorder[i].first << ' ' << leftBorder[i].second << endl;
    }

    bool inside(point X)
    {
        int low,high,mid,leftPos = -1,rightPos = -1;

        low = 0;  high = leftBorder.size() - 1;
        while (low <= high)
        {
            mid = (low + high)/2;
            if (leftBorder[mid].second >= X.second)
            {
                leftPos = mid;  low = mid + 1;
            }
            else high = mid - 1;
        }
        if (leftPos == leftBorder.size() - 1) leftPos--;
        if (leftPos < 0) return false;

        low = 0;  high = rightBorder.size() - 1;
        while (low <= high)
        {
            mid = (low + high)/2;
            if (rightBorder[mid].second <= X.second)
            {
                rightPos = mid;  low = mid + 1;
            }
            else high = mid - 1;
        }
        if (rightPos == rightBorder.size() - 1) rightPos--;
        if (rightPos < 0) return false;

        int z = 1;
        z *= ccw(leftBorder[leftPos],leftBorder[leftPos + 1],X);
        z *= ccw(rightBorder[rightPos],rightBorder[rightPos + 1],X);
        return (z >= 0);
    }

    polygon MinkowskiSum(polygon A,polygon B)
    {
        int startA = 0,startB = 0;
        for (int i = 1; i < A.vertices.size(); i++)
          if (A.vertices[i] < A.vertices[startA]) startA = i;
        for (int i = 1; i < B.vertices.size(); i++)
          if (B.vertices[i] < B.vertices[startB]) startB = i;

        int finishA = startA,finishB = startB;
        polygon C;
        while (1)
        {
            C.vertices.push_back(sum(A.vertices[startA],B.vertices[startB]));
            int nextA = (startA + 1) % A.vertices.size(),nextB = (startB + 1) % B.vertices.size();

            point p1 = A.vertices[startA],p2 = A.vertices[nextA],p3 = B.vertices[startB],p4 = B.vertices[nextB];
            int ax = p2.first - p1.first,ay = p2.second - p1.second,bx = p4.first - p3.first,by = p4.second - p3.second;
            long long direc = 1LL * ax * by - 1LL * ay * bx;
            if (direc >= 0) startA = nextA;
            if (direc <= 0) startB = nextB;
            if (startA == finishA && startB == finishB) break;
        }
        return C;
    }
} P[3];

int main()
{
    //freopen("e.in","r",stdin);
    for (int i = 0; i < 3; i++) P[i].loadPolygon();
    for (int i = 1; i < 3; i++) P[0] = P[0].MinkowskiSum(P[0],P[i]);

    P[0].prepareBorder();
    int Q;  scanf("%d", &Q);
    while (Q--)
    {
        pair<int,int> X;  scanf("%d %d", &X.first, &X.second);
        X.first *= 3;  X.second *= 3;
        if (P[0].inside(X)) printf("YES\n"); else printf("NO\n");
    }
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

struct Point{
	ll x, y;
	Point(){}
	Point(ll ix, ll iy){
		x = ix; y = iy;
	}
	Point operator+(Point a){
		return Point(x + a.x, y + a.y);
	}
	Point operator-(Point a){
		return Point(x - a.x, y - a.y);
	}
};

inline ll cross(Point a, Point b){
	return a.x*b.y - a.y*b.x;
}

inline bool compare(Point a, Point b){
	int A = ((a.y > 0) || (a.x > 0))?0:1;
	int B = ((b.y > 0) || (b.x > 0))?0:1;
	if(A == B)return cross(a, b) > 0;
	return A < B;
}

inline vector<Point> combine(vector<Point> a, vector<Point> b){
	vector<Point> ret;
	ret.push_back(a[0] + b[0]);
	a.push_back(a[0]);
	b.push_back(b[0]);
	int sza = a.size();
	int szb = b.size();
	int i = 1, j = 1;
	while(i < sza || j < szb){
		if(i == sza){
			ret.push_back(ret.back() + b[j] - b[j - 1]);
			j++;
		}else if(j == szb){
			ret.push_back(ret.back() + a[i] - a[i - 1]);
			i++;
		}else{
			if(compare(a[i] - a[i - 1], b[j] - b[j - 1])){
				ret.push_back(ret.back() + a[i] - a[i - 1]);
				i++;
			}else{
				ret.push_back(ret.back() + b[j] - b[j - 1]);
				j++;
			}
		}
	}
	ret.pop_back();
	return ret;
}

inline int sign(ll x){
	if(x == 0)return x;
	if(x > 0)return 1;
	return -1;
}

inline bool isInside(Point a, Point b, Point c, Point pt){
	int A = sign(cross(a - pt, b - pt));
	int B = sign(cross(b - pt, c - pt));
	int C = sign(cross(c - pt, a - pt));
	return (A == 0 || B == 0 || C == 0) || (A == B && B == C);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<setprecision(32);

	vector<Point> a[3];
	for(int i = 0; i < 3; i++){
		int n; cin>>n;
		a[i].resize(n);
		for(auto &x : a[i]){
			cin>>x.x>>x.y;
		}
		int ind = 0;
		for(int j = 1; j < n; j++){
			if(a[i][j].x < a[i][ind].x)ind = j;
			else if(a[i][j].x == a[i][ind].x && a[i][j].y < a[i][ind].y)ind = j;
		}
		rotate(a[i].begin(), a[i].begin() + ind, a[i].end());
	}
	vector<Point> hull = combine(a[0], combine(a[1], a[2]));
	// for(auto x : hull){
	// 	cout<<x.x<<" "<<x.y<<endl;
	// }
	hull.pop_back();
	int sz = hull.size();
	int m; cin>>m;
	while(m--){
		ll x, y; cin>>x>>y;
		Point pt(3*x, 3*y);
		if(pt.x == hull[0].x && pt.y == hull[0].y){
			cout<<"YES\n";
			continue;
		}
		int lo = 1, hi = sz - 1;
		while(lo < hi){
			int mi = lo + (hi - lo + 1)/2;
			if(compare(hull[mi] - hull[0], pt - hull[0]))lo = mi;
			else hi = mi - 1;
		}
		if(lo == sz - 1){
			cout<<"NO\n";
		}else{
			if(isInside(hull[lo], hull[lo + 1], hull[0], pt)){
				cout<<"YES\n";
			}else{
				cout<<"NO\n";
			}
		}
	}

	return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>

#include <string>
#include <sstream>
#include <algorithm>
#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <map>

using namespace std;

#define Eo(x) { cerr << #x << " = " << (x) << endl; }
#define sz(x) (int((x).size()))
#define foreach(i, x) for(__typeof((x).begin()) i = (x).begin(); i != (x).end(); i ++)

template<typename A, typename B> ostream& operator<<(ostream& os, const pair<A, B>& p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename C> ostream& operator<<(ostream& os, const vector<C>& v) { foreach(__it, v) os << *(__it) << ' '; return os; }

typedef double real;
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int, int> pip;

const int inf = 0x3f3f3f3f;
const real eps = 1e-5;

template<class T>
struct Point {
	T x, y;

	Point() : x(0), y(0) {}
	Point(T a, T b) : x(a), y(b) {}

	bool half() const {
		return y<0 || (y==0 && x < 0);
	}

	T scal(const Point& other) const {
		return x*other.x + y*other.y;
	}

	T vect(const Point& other) const {
		return x*other.y - y*other.x;
	}

	bool operator<(const Point& other) const {
		bool ah = half();
		bool bh = other.half();
		if(ah^bh) return ah<bh;
		return vect(other) > 0;
	}

	Point operator-(const Point& other) const {
		return Point(x-other.x, y-other.y);
	}

	Point operator+(const Point& other) const {
		return Point(other.x+x, other.y+y);
	}
};
typedef Point<int64> point;
ostream& operator<<(ostream& os, const point& p) {
	return os << p.x << ' ' << p.y;
}

int64 getS(const point& a, const point& b, const point& c) {
	return a.vect(b) + b.vect(c) + c.vect(a);
}

const int maxn = 100500;
point ps[3][maxn];
point down[3];
point vs[3*maxn];
point res[3*maxn];

int main() {
	int last = 0;
	for(int i=0; i<3; i++) {
		int n; cin >> n;
		for(int j=0; j<n; j++) cin >> ps[i][j].x >> ps[i][j].y;
		ps[i][n] = ps[i][0];
		down[i] = ps[i][0];

		for(int j=1; j<=n; j++) {
			vs[last++] = point(ps[i][j] - ps[i][j-1]);
			if(ps[i][j].y < down[i].y || (ps[i][j].y == down[i].y && ps[i][j].x < down[i].x)) down[i] = ps[i][j];
		}
	}

	sort(vs, vs+last);
	point start = down[0] + down[1] + down[2];
	Eo(start);

	res[0] = point(0, 0);
	for(int i=0; i<last; i++) {
		res[i+1] = res[i] + vs[i];
		//Eo(vs[i]);Eo(res[i+1]);
	}
	//Eo(res[0].x); Eo(res[0].y); Eo(res[last].x); Eo(res[last].y);

	int T; cin >> T;
	while(T--) {
		int x, y; cin >> x >> y;
		point p(x*3, y*3);
		p = p-start;

		int left = 0, right = last;
		while(right-left>1) {
			int mid = (left+right)/2;
			if(p < res[mid])
				right = mid;
			else if(res[mid+1] < p && mid+1<last)
				left = mid;
			else {
				left = mid;
				right = mid+1;
				break;
			}
		}
		//Eo(res[left]); Eo(res[right]);

		if(getS(res[left], res[right], p) >= 0)
			puts("YES");
		else
			puts("NO");
	}

	return 0;
}

#include <stdio.h>
#include <math.h>
#include <algorithm>
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);
        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) left=i;
            if (sgn(pp[i].x-pp[right].x)>=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;
}

#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<climits>
#include<complex>
#define mp make_pair
#define pb push_back
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
const double inf=1e20;
const int maxp=1111;
int dblcmp(double d)
{
    if (fabs(d)<eps)return 0;
    return d>eps?1:-1;
}
inline double sqr(double x){return x*x;}
struct point
{
    double x,y;
    point(){}
    point(double _x,double _y):
    x(_x),y(_y){};
    void input()
    {
        scanf("%lf%lf",&x,&y);
    }
    void output()
    {
        printf("%.2f %.2f\n",x,y);
    }
    bool operator==(point a)const
    {
        return dblcmp(a.x-x)==0&&dblcmp(a.y-y)==0;
    }
    bool operator<(point a)const
    {
        return dblcmp(a.x-x)==0?dblcmp(y-a.y)<0:x<a.x;
    }
    double len()
    {
        return hypot(x,y);
    }
    double len2()
    {
        return x*x+y*y;
    }
    double distance(point p)
    {
        return hypot(x-p.x,y-p.y);
    }
    point add(point p)
    {
        return point(x+p.x,y+p.y);
    }
    point sub(point p)
    {
        return point(x-p.x,y-p.y);
    }
    point mul(double b)
    {
        return point(x*b,y*b);
    }
    point div(double b)
    {
        return point(x/b,y/b);
    }
    double dot(point p)
    {
        return x*p.x+y*p.y;
    }
    double det(point p)
    {
        return x*p.y-y*p.x;
    }
    double rad(point a,point b)
    {
        point p=*this;
        return fabs(atan2(fabs(a.sub(p).det(b.sub(p))),a.sub(p).dot(b.sub(p))));
    }
    point trunc(double r)
    {
        double l=len();
        if (!dblcmp(l))return *this;
        r/=l;
        return point(x*r,y*r);
    }
    point rotleft()
    {
        return point(-y,x);
    }
    point rotright()
    {
        return point(y,-x);
    }
    point rotate(point p,double angle)//绕点p逆时针旋转angle角度
    {
        point v=this->sub(p);
        double c=cos(angle),s=sin(angle);
        return point(p.x+v.x*c-v.y*s,p.y+v.x*s+v.y*c);
    }
};
struct line
{
    point a,b;
    line(){}
    line(point _a,point _b)
    {
        a=_a;
        b=_b;
    }
    bool operator==(line v)
    {
        return (a==v.a)&&(b==v.b);
    }
    //倾斜角angle
    line(point p,double angle)
    {
        a=p;
        if (dblcmp(angle-pi/2)==0)
        {
            b=a.add(point(0,1));
        }
        else
        {
            b=a.add(point(1,tan(angle)));
        }
    }
    //ax+by+c=0
    line(double _a,double _b,double _c)
    {
        if (dblcmp(_a)==0)
        {
            a=point(0,-_c/_b);
            b=point(1,-_c/_b);
        }
        else if (dblcmp(_b)==0)
        {
            a=point(-_c/_a,0);
            b=point(-_c/_a,1);
        }
        else
        {
            a=point(0,-_c/_b);
            b=point(1,(-_c-_a)/_b);
        }
    }
    void input()
    {
        a.input();
        b.input();
    }
    void adjust()
    {
        if (b<a)swap(a,b);
    }
    double length()
    {
        return a.distance(b);
    }
    double angle()//直线倾斜角 0<=angle<180
    {
        double k=atan2(b.y-a.y,b.x-a.x);
        if (dblcmp(k)<0)k+=pi;
        if (dblcmp(k-pi)==0)k-=pi;
        return k;
    }
    //点和线段关系
    //1 在逆时针
    //2 在顺时针
    //3 平行
    int relation(point p)
    {
        int c=dblcmp(p.sub(a).det(b.sub(a)));
        if (c<0)return 1;
        if (c>0)return 2;
        return 3;
    }
    bool pointonseg(point p)
    {
        return dblcmp(p.sub(a).det(b.sub(a)))==0&&dblcmp(p.sub(a).dot(p.sub(b)))<=0;
    }
    bool parallel(line v)
    {
        return dblcmp(b.sub(a).det(v.b.sub(v.a)))==0;
    }
    //2 规范相交
    //1 非规范相交
    //0 不相交
    int segcrossseg(line v)
    {
        int d1=dblcmp(b.sub(a).det(v.a.sub(a)));
        int d2=dblcmp(b.sub(a).det(v.b.sub(a)));
        int d3=dblcmp(v.b.sub(v.a).det(a.sub(v.a)));
        int d4=dblcmp(v.b.sub(v.a).det(b.sub(v.a)));
        if ((d1^d2)==-2&&(d3^d4)==-2)return 2;
        return (d1==0&&dblcmp(v.a.sub(a).dot(v.a.sub(b)))<=0||
                d2==0&&dblcmp(v.b.sub(a).dot(v.b.sub(b)))<=0||
                d3==0&&dblcmp(a.sub(v.a).dot(a.sub(v.b)))<=0||
                d4==0&&dblcmp(b.sub(v.a).dot(b.sub(v.b)))<=0);
    }
    int linecrossseg(line v)//*this seg v line
    {
        int d1=dblcmp(b.sub(a).det(v.a.sub(a)));
        int d2=dblcmp(b.sub(a).det(v.b.sub(a)));
        if ((d1^d2)==-2)return 2;
        return (d1==0||d2==0);
    }
    //0 平行
    //1 重合
    //2 相交
    int linecrossline(line v)
    {
        if ((*this).parallel(v))
        {
            return v.relation(a)==3;
        }
        return 2;
    }
    point crosspoint(line v)
    {
        double a1=v.b.sub(v.a).det(a.sub(v.a));
        double a2=v.b.sub(v.a).det(b.sub(v.a));
        return point((a.x*a2-b.x*a1)/(a2-a1),(a.y*a2-b.y*a1)/(a2-a1));
    }
    double dispointtoline(point p)
    {
        return fabs(p.sub(a).det(b.sub(a)))/length();
    }
    double dispointtoseg(point p)
    {
        if (dblcmp(p.sub(b).dot(a.sub(b)))<0||dblcmp(p.sub(a).dot(b.sub(a)))<0)
        {
            return min(p.distance(a),p.distance(b));
        }
        return dispointtoline(p);
    }
    point lineprog(point p)
    {
        return a.add(b.sub(a).mul(b.sub(a).dot(p.sub(a))/b.sub(a).len2()));
    }
    point symmetrypoint(point p)
    {
        point q=lineprog(p);
        return point(2*q.x-p.x,2*q.y-p.y);
    }
};
struct circle
{
    point p;
    double r;
    circle(){}
    circle(point _p,double _r):
    p(_p),r(_r){};
    circle(double x,double y,double _r):
    p(point(x,y)),r(_r){};
    circle(point a,point b,point c)//三角形的外接圆
    {
        p=line(a.add(b).div(2),a.add(b).div(2).add(b.sub(a).rotleft())).crosspoint(line(c.add(b).div(2),c.add(b).div(2).add(b.sub(c).rotleft())));
        r=p.distance(a);
    }
    circle(point a,point b,point c,bool t)//三角形的内切圆
    {
        line u,v;
        double m=atan2(b.y-a.y,b.x-a.x),n=atan2(c.y-a.y,c.x-a.x);
        u.a=a;
        u.b=u.a.add(point(cos((n+m)/2),sin((n+m)/2)));
        v.a=b;
        m=atan2(a.y-b.y,a.x-b.x),n=atan2(c.y-b.y,c.x-b.x);
        v.b=v.a.add(point(cos((n+m)/2),sin((n+m)/2)));
        p=u.crosspoint(v);
        r=line(a,b).dispointtoseg(p);
    }
    void input()
    {
        p.input();
        scanf("%lf",&r);
    }
    void output()
    {
        printf("%.2lf %.2lf %.2lf\n",p.x,p.y,r);
    }
    bool operator==(circle v)
    {
        return ((p==v.p)&&dblcmp(r-v.r)==0);
    }
    bool operator<(circle v)const
    {
        return ((p<v.p)||(p==v.p)&&dblcmp(r-v.r)<0);
    }
    double area()
    {
        return pi*sqr(r);
    }
    double circumference()
    {
        return 2*pi*r;
    }
    //0 圆外
    //1 圆上
    //2 圆内
    int relation(point b)
    {
        double dst=b.distance(p);
        if (dblcmp(dst-r)<0)return 2;
        if (dblcmp(dst-r)==0)return 1;
        return 0;
    }
    int relationseg(line v)
    {
        double dst=v.dispointtoseg(p);
        if (dblcmp(dst-r)<0)return 2;
        if (dblcmp(dst-r)==0)return 1;
        return 0;
    }
    int relationline(line v)
    {
        double dst=v.dispointtoline(p);
        if (dblcmp(dst-r)<0)return 2;
        if (dblcmp(dst-r)==0)return 1;
        return 0;
    }
    //过a b两点 半径r的两个圆
    int getcircle(point a,point b,double r,circle&c1,circle&c2)
    {
        circle x(a,r),y(b,r);
        int t=x.pointcrosscircle(y,c1.p,c2.p);
        if (!t)return 0;
        c1.r=c2.r=r;
        return t;
    }
    //与直线u相切 过点q 半径r1的圆
    int getcircle(line u,point q,double r1,circle &c1,circle &c2)
    {
        double dis=u.dispointtoline(q);
        if (dblcmp(dis-r1*2)>0)return 0;
        if (dblcmp(dis)==0)
        {
            c1.p=q.add(u.b.sub(u.a).rotleft().trunc(r1));
            c2.p=q.add(u.b.sub(u.a).rotright().trunc(r1));
            c1.r=c2.r=r1;
            return 2;
        }
        line u1=line(u.a.add(u.b.sub(u.a).rotleft().trunc(r1)),u.b.add(u.b.sub(u.a).rotleft().trunc(r1)));
        line u2=line(u.a.add(u.b.sub(u.a).rotright().trunc(r1)),u.b.add(u.b.sub(u.a).rotright().trunc(r1)));
        circle cc=circle(q,r1);
        point p1,p2;
        if (!cc.pointcrossline(u1,p1,p2))cc.pointcrossline(u2,p1,p2);
        c1=circle(p1,r1);
        if (p1==p2)
        {
            c2=c1;return 1;
        }
        c2=circle(p2,r1);
        return 2;
    }
    //同时与直线u,v相切 半径r1的圆
    int getcircle(line u,line v,double r1,circle &c1,circle &c2,circle &c3,circle &c4)
    {
        if (u.parallel(v))return 0;
        line u1=line(u.a.add(u.b.sub(u.a).rotleft().trunc(r1)),u.b.add(u.b.sub(u.a).rotleft().trunc(r1)));
        line u2=line(u.a.add(u.b.sub(u.a).rotright().trunc(r1)),u.b.add(u.b.sub(u.a).rotright().trunc(r1)));
        line v1=line(v.a.add(v.b.sub(v.a).rotleft().trunc(r1)),v.b.add(v.b.sub(v.a).rotleft().trunc(r1)));
        line v2=line(v.a.add(v.b.sub(v.a).rotright().trunc(r1)),v.b.add(v.b.sub(v.a).rotright().trunc(r1)));
        c1.r=c2.r=c3.r=c4.r=r1;
        c1.p=u1.crosspoint(v1);
        c2.p=u1.crosspoint(v2);
        c3.p=u2.crosspoint(v1);
        c4.p=u2.crosspoint(v2);
        return 4;
    }
    //同时与不相交圆cx,cy相切 半径为r1的圆
    int getcircle(circle cx,circle cy,double r1,circle&c1,circle&c2)
    {
        circle x(cx.p,r1+cx.r),y(cy.p,r1+cy.r);
        int t=x.pointcrosscircle(y,c1.p,c2.p);
        if (!t)return 0;
        c1.r=c2.r=r1;
        return t;
    }
    int pointcrossline(line v,point &p1,point &p2)//求与线段交要先判断relationseg
    {
        if (!(*this).relationline(v))return 0;
        point a=v.lineprog(p);
        double d=v.dispointtoline(p);
        d=sqrt(r*r-d*d);
        if (dblcmp(d)==0)
        {
            p1=a;
            p2=a;
            return 1;
        }
        p1=a.sub(v.b.sub(v.a).trunc(d));
        p2=a.add(v.b.sub(v.a).trunc(d));
        return 2;
    }
    //5 相离
    //4 外切
    //3 相交
    //2 内切
    //1 内含
    int relationcircle(circle v)
    {
        double d=p.distance(v.p);
        if (dblcmp(d-r-v.r)>0)return 5;
        if (dblcmp(d-r-v.r)==0)return 4;
        double l=fabs(r-v.r);
        if (dblcmp(d-r-v.r)<0&&dblcmp(d-l)>0)return 3;
        if (dblcmp(d-l)==0)return 2;
        if (dblcmp(d-l)<0)return 1;
    }
    int pointcrosscircle(circle v,point &p1,point &p2)
    {
        int rel=relationcircle(v);
        if (rel==1||rel==5)return 0;
        double d=p.distance(v.p);
        double l=(d+(sqr(r)-sqr(v.r))/d)/2;
        double h=sqrt(sqr(r)-sqr(l));
        p1=p.add(v.p.sub(p).trunc(l).add(v.p.sub(p).rotleft().trunc(h)));
        p2=p.add(v.p.sub(p).trunc(l).add(v.p.sub(p).rotright().trunc(h)));
        if (rel==2||rel==4)
        {
            return 1;
        }
        return 2;
    }
    //过一点做圆的切线 (先判断点和圆关系)
    int tangentline(point q,line &u,line &v)
    {
        int x=relation(q);
        if (x==2)return 0;
        if (x==1)
        {
            u=line(q,q.add(q.sub(p).rotleft()));
            v=u;
            return 1;
        }
        double d=p.distance(q);
        double l=sqr(r)/d;
        double h=sqrt(sqr(r)-sqr(l));
        u=line(q,p.add(q.sub(p).trunc(l).add(q.sub(p).rotleft().trunc(h))));
        v=line(q,p.add(q.sub(p).trunc(l).add(q.sub(p).rotright().trunc(h))));
        return 2;
    }
    double areacircle(circle v)
    {
        int rel=relationcircle(v);
        if (rel>=4)return 0.0;
        if (rel<=2)return min(area(),v.area());
        double d=p.distance(v.p);
        double hf=(r+v.r+d)/2.0;
        double ss=2*sqrt(hf*(hf-r)*(hf-v.r)*(hf-d));
        double a1=acos((r*r+d*d-v.r*v.r)/(2.0*r*d));
        a1=a1*r*r;
        double a2=acos((v.r*v.r+d*d-r*r)/(2.0*v.r*d));
        a2=a2*v.r*v.r;
        return a1+a2-ss;
    }
    double areatriangle(point a,point b)
    {
        if (dblcmp(p.sub(a).det(p.sub(b))==0))return 0.0;
        point q[5];
        int len=0;
        q[len++]=a;
        line l(a,b);
        point p1,p2;
        if (pointcrossline(l,q[1],q[2])==2)
        {
            if (dblcmp(a.sub(q[1]).dot(b.sub(q[1])))<0)q[len++]=q[1];
            if (dblcmp(a.sub(q[2]).dot(b.sub(q[2])))<0)q[len++]=q[2];
        }
        q[len++]=b;
        if (len==4&&(dblcmp(q[0].sub(q[1]).dot(q[2].sub(q[1])))>0))swap(q[1],q[2]);
        double res=0;
        int i;
        for (i=0;i<len-1;i++)
        {
            if (relation(q[i])==0||relation(q[i+1])==0)
            {
                double arg=p.rad(q[i],q[i+1]);
                res+=r*r*arg/2.0;
            }
            else
            {
                res+=fabs(q[i].sub(p).det(q[i+1].sub(p))/2.0);
            }
        }
        return res;
    }
};
struct polygon
{
    int n;
    point p[maxp];
    line l[maxp];
    void input()
    {
        scanf("%d",&n);
        for (int i=0;i<n;i++)
        {
            p[i].input();
        }
    }
    void add(point q)
    {
        p[n++]=q;
    }
    void getline()
    {
        for (int i=0;i<n;i++)
        {
            l[i]=line(p[i],p[(i+1)%n]);
        }
    }
    struct cmp
    {
        point p;
        cmp(const point &p0){p=p0;}
        bool operator()(const point &aa,const point &bb)
        {
            point a=aa,b=bb;
            int d=dblcmp(a.sub(p).det(b.sub(p)));
            if (d==0)
            {
                return dblcmp(a.distance(p)-b.distance(p))<0;
            }
            return d>0;
        }
    };
    void norm()
    {
        point mi=p[0];
        for (int i=1;i<n;i++)mi=min(mi,p[i]);
        sort(p,p+n,cmp(mi));
    }
    void getconvex(polygon &convex)
    {
        int i,j,k;
        sort(p,p+n);
        convex.n=n;
        for (i=0;i<min(n,2);i++)
        {
            convex.p[i]=p[i];
        }
        if (n<=2)return;
        int &top=convex.n;
        top=1;
        for (i=2;i<n;i++)
        {
            while (top&&convex.p[top].sub(p[i]).det(convex.p[top-1].sub(p[i]))<=0)
                top--;
            convex.p[++top]=p[i];
        }
        int temp=top;
        convex.p[++top]=p[n-2];
        for (i=n-3;i>=0;i--)
        {
            while (top!=temp&&convex.p[top].sub(p[i]).det(convex.p[top-1].sub(p[i]))<=0)
                top--;
            convex.p[++top]=p[i];
        }
    }
    bool isconvex()
    {
        bool s[3];
        memset(s,0,sizeof(s));
        int i,j,k;
        for (i=0;i<n;i++)
        {
            j=(i+1)%n;
            k=(j+1)%n;
            s[dblcmp(p[j].sub(p[i]).det(p[k].sub(p[i])))+1]=1;
            if (s[0]&&s[2])return 0;
        }
        return 1;
    }
    //3 点上
    //2 边上
    //1 内部
    //0 外部
    int relationpoint(point q)
    {
        int i,j;
        for (i=0;i<n;i++)
        {
            if (p[i]==q)return 3;
        }
        getline();
        for (i=0;i<n;i++)
        {
            if (l[i].pointonseg(q))return 2;
        }
        int cnt=0;
        for (i=0;i<n;i++)
        {
            j=(i+1)%n;
            int k=dblcmp(q.sub(p[j]).det(p[i].sub(p[j])));
            int u=dblcmp(p[i].y-q.y);
            int v=dblcmp(p[j].y-q.y);
            if (k>0&&u<0&&v>=0)cnt++;
            if (k<0&&v<0&&u>=0)cnt--;
        }
        return cnt!=0;
    }
    //1 在多边形内长度为正
    //2 相交或与边平行
    //0 无任何交点
    int relationline(line u)
    {
        int i,j,k=0;
        getline();
        for (i=0;i<n;i++)
        {
            if (l[i].segcrossseg(u)==2)return 1;
            if (l[i].segcrossseg(u)==1)k=1;
        }
        if (!k)return 0;
        vector<point>vp;
        for (i=0;i<n;i++)
        {
            if (l[i].segcrossseg(u))
            {
                if (l[i].parallel(u))
                {
                    vp.pb(u.a);
                    vp.pb(u.b);
                    vp.pb(l[i].a);
                    vp.pb(l[i].b);
                    continue;
                }
                vp.pb(l[i].crosspoint(u));
            }
        }
        sort(vp.begin(),vp.end());
        int sz=vp.size();
        for (i=0;i<sz-1;i++)
        {
            point mid=vp[i].add(vp[i+1]).div(2);
            if (relationpoint(mid)==1)return 1;
        }
        return 2;
    }
    //直线u切割凸多边形左侧
    //注意直线方向
    void convexcut(line u,polygon &po)
    {
        int i,j,k;
        int &top=po.n;
        top=0;
        for (i=0;i<n;i++)
        {
            int d1=dblcmp(p[i].sub(u.a).det(u.b.sub(u.a)));
            int d2=dblcmp(p[(i+1)%n].sub(u.a).det(u.b.sub(u.a)));
            if (d1>=0)po.p[top++]=p[i];
            if (d1*d2<0)po.p[top++]=u.crosspoint(line(p[i],p[(i+1)%n]));
        }
    }
    double getcircumference()
    {
        double sum=0;
        int i;
        for (i=0;i<n;i++)
        {
            sum+=p[i].distance(p[(i+1)%n]);
        }
        return sum;
    }
    double getarea()
    {
        double sum=0;
        int i;
        for (i=0;i<n;i++)
        {
            sum+=p[i].det(p[(i+1)%n]);
        }
        return fabs(sum)/2;
    }
    bool getdir()//1代表逆时针 0代表顺时针
    {
        double sum=0;
        int i;
        for (i=0;i<n;i++)
        {
            sum+=p[i].det(p[(i+1)%n]);
        }
        if (dblcmp(sum)>0)return 1;
        return 0;
    }
    point getbarycentre()
    {
        point ret(0,0);
        double area=0;
        int i;
        for (i=1;i<n-1;i++)
        {
            double tmp=p[i].sub(p[0]).det(p[i+1].sub(p[0]));
            if (dblcmp(tmp)==0)continue;
            area+=tmp;
            ret.x+=(p[0].x+p[i].x+p[i+1].x)/3*tmp;
            ret.y+=(p[0].y+p[i].y+p[i+1].y)/3*tmp;
        }
        if (dblcmp(area))ret=ret.div(area);
        return ret;
    }
    double areaintersection(polygon po)
    {
    }
    double areaunion(polygon po)
    {
        return getarea()+po.getarea()-areaintersection(po);
    }
    double areacircle(circle c)
    {
        int i,j,k,l,m;
        double ans=0;
        for (i=0;i<n;i++)
        {
            int j=(i+1)%n;
            if (dblcmp(p[j].sub(c.p).det(p[i].sub(c.p)))>=0)
            {
                ans+=c.areatriangle(p[i],p[j]);
            }
            else
            {
                ans-=c.areatriangle(p[i],p[j]);
            }
        }
        return fabs(ans);
    }
    //多边形和圆关系
    //0 一部分在圆外
    //1 与圆某条边相切
    //2 完全在圆内
    int relationcircle(circle c)
    {
        getline();
        int i,x=2;
        if (relationpoint(c.p)!=1)return 0;
        for (i=0;i<n;i++)
        {
            if (c.relationseg(l[i])==2)return 0;
            if (c.relationseg(l[i])==1)x=1;
        }
        return x;
    }
    void find(int st,point tri[],circle &c)
    {
        if (!st)
        {
            c=circle(point(0,0),-2);
        }
        if (st==1)
        {
            c=circle(tri[0],0);
        }
        if (st==2)
        {
            c=circle(tri[0].add(tri[1]).div(2),tri[0].distance(tri[1])/2.0);
        }
        if (st==3)
        {
            c=circle(tri[0],tri[1],tri[2]);
        }
    }
    void solve(int cur,int st,point tri[],circle &c)
    {
        find(st,tri,c);
        if (st==3)return;
        int i;
        for (i=0;i<cur;i++)
        {
            if (dblcmp(p[i].distance(c.p)-c.r)>0)
            {
                tri[st]=p[i];
                solve(i,st+1,tri,c);
            }
        }
    }
    circle mincircle()//点集最小圆覆盖
    {
        random_shuffle(p,p+n);
        point tri[4];
        circle c;
        solve(n,0,tri,c);
        return c;
    }
    int circlecover(double r)//单位圆覆盖
    {
        int ans=0,i,j;
        vector<pair<double,int> >v;
        for (i=0;i<n;i++)
        {
            v.clear();
            for (j=0;j<n;j++)if (i!=j)
            {
                point q=p[i].sub(p[j]);
                double d=q.len();
                if (dblcmp(d-2*r)<=0)
                {
                    double arg=atan2(q.y,q.x);
                    if (dblcmp(arg)<0)arg+=2*pi;
                    double t=acos(d/(2*r));
                    v.push_back(make_pair(arg-t+2*pi,-1));
                    v.push_back(make_pair(arg+t+2*pi,1));
                }
            }
            sort(v.begin(),v.end());
            int cur=0;
            for (j=0;j<v.size();j++)
            {
                if (v[j].second==-1)++cur;
                else --cur;
                ans=max(ans,cur);
            }
        }
        return ans+1;
    }
    int pointinpolygon(point q)//点在凸多边形内部的判定
    {
        if (getdir())reverse(p,p+n);
        if (dblcmp(q.sub(p[0]).det(p[n-1].sub(p[0])))==0)
        {
            if (line(p[n-1],p[0]).pointonseg(q))return n-1;
            return -1;
        }
        int low=1,high=n-2,mid;
        while (low<=high)
        {
            mid=(low+high)>>1;
            if (dblcmp(q.sub(p[0]).det(p[mid].sub(p[0])))>=0&&dblcmp(q.sub(p[0]).det(p[mid+1].sub(p[0])))<0)
            {
                polygon c;
                c.p[0]=p[mid];
                c.p[1]=p[mid+1];
                c.p[2]=p[0];
                c.n=3;
                if (c.relationpoint(q))return mid;
                return -1;
            }
            if (dblcmp(q.sub(p[0]).det(p[mid].sub(p[0])))>0)
            {
                low=mid+1;
            }
            else
            {
                high=mid-1;
            }
        }
        return -1;
    }
    void minkowskisum(polygon a,polygon &b)
    {
        int i,j,ia=0,ib=0;
        for (i=0;i<n;i++)
        {
            if (dblcmp(p[i].y-p[ia].y)<0||(dblcmp(p[i].y-p[ia].y)==0&&dblcmp(p[i].x-p[ia].x)<0))ia=i;
            if (dblcmp(a.p[i].y-a.p[ib].y)<0||(dblcmp(a.p[i].y-a.p[ib].y)==0&&dblcmp(a.p[i].x-a.p[ib].x)<0))ib=i;
        }
        b.n=0;
        b.add(p[ia].add(a.p[ib]));
        i=j=0;
        while (i<n||j<a.n)
        {
            int t;
            if (i==n)t=1;
            else if (j==a.n)t=0;
            else
            {
                int k=(ia+i)%n;
                int nk=(k+1)%n;
                double va=atan2(p[nk].y-p[k].y,p[nk].x-p[k].x);
                k=(ib+j)%a.n;
                nk=(k+1)%a.n;
                double vb=atan2(a.p[nk].y-a.p[k].y,a.p[nk].x-a.p[k].x);
                if (dblcmp(va)<0)va+=2*pi;
                if (dblcmp(vb)<0)vb+=2*pi;
                t=(va>vb);
            }
            if (t)
            {
                int k=(ib+j)%a.n;
                int nk=(k+1)%a.n;
                b.add(a.p[nk].sub(a.p[k]).add(b.p[b.n-1]));
                j++;
            }
            else
            {
                int k=(ia+i)%n;
                int nk=(k+1)%n;
                b.add(p[nk].sub(p[k]).add(b.p[b.n-1]));
                i++;
            }
        }
        b.n--;
    }
};
struct polygons
{
    vector<polygon>p;
    polygons()
    {
        p.clear();
    }
    void clear()
    {
        p.clear();
    }
    void push(polygon q)
    {
        if (dblcmp(q.getarea()))p.pb(q);
    }
    vector<pair<double,int> >e;
    void ins(point s,point t,point X,int i)
    {
        double r=fabs(t.x-s.x)>eps?(X.x-s.x)/(t.x-s.x):(X.y-s.y)/(t.y-s.y);
        r=min(r,1.0);r=max(r,0.0);
        e.pb(mp(r,i));
    }
    double polyareaunion()
    {
        double ans=0.0;
        int c0,c1,c2,i,j,k,w;
        for (i=0;i<p.size();i++)
        {
            if (p[i].getdir()==0)reverse(p[i].p,p[i].p+p[i].n);
        }
        for (i=0;i<p.size();i++)
        {
            for (k=0;k<p[i].n;k++)
            {
                point &s=p[i].p[k],&t=p[i].p[(k+1)%p[i].n];
                if (!dblcmp(s.det(t)))continue;
                e.clear();
                e.pb(mp(0.0,1));
                e.pb(mp(1.0,-1));
                for (j=0;j<p.size();j++)if (i!=j)
                {
                    for (w=0;w<p[j].n;w++)
                    {
                        point a=p[j].p[w],b=p[j].p[(w+1)%p[j].n],c=p[j].p[(w-1+p[j].n)%p[j].n];
                        c0=dblcmp(t.sub(s).det(c.sub(s)));
                        c1=dblcmp(t.sub(s).det(a.sub(s)));
                        c2=dblcmp(t.sub(s).det(b.sub(s)));
                        if (c1*c2<0)ins(s,t,line(s,t).crosspoint(line(a,b)),-c2);
                        else if (!c1&&c0*c2<0)ins(s,t,a,-c2);
                        else if (!c1&&!c2)
                        {
                            int c3=dblcmp(t.sub(s).det(p[j].p[(w+2)%p[j].n].sub(s)));
                            int dp=dblcmp(t.sub(s).dot(b.sub(a)));
                            if (dp&&c0)ins(s,t,a,dp>0?c0*((j>i)^(c0<0)):-(c0<0));
                            if (dp&&c3)ins(s,t,b,dp>0?-c3*((j>i)^(c3<0)):c3<0);
                        }
                    }
                }
                sort(e.begin(),e.end());
                int ct=0;
                double tot=0.0,last;
                for (j=0;j<e.size();j++)
                {
                    if (ct==1)tot+=e[j].first-last;
                    ct+=e[j].second;
                    last=e[j].first;
                }
                ans+=s.det(t)*tot;
            }
        }
        return fabs(ans)*0.5;
    }
};
const int maxn=500;
struct circles
{
    circle c[maxn];
    double ans[maxn];//ans[i]表示被覆盖了i次的面积
    double pre[maxn];
    int n;
    circles(){}
    void add(circle cc)
    {
        c[n++]=cc;
    }
    bool inner(circle x,circle y)
    {
        if (x.relationcircle(y)!=1)return 0;
        return dblcmp(x.r-y.r)<=0?1:0;
    }
    void init_or()//圆的面积并去掉内含的圆
    {
        int i,j,k=0;
        bool mark[maxn]={0};
        for (i=0;i<n;i++)
        {
            for (j=0;j<n;j++)if (i!=j&&!mark[j])
            {
                if ((c[i]==c[j])||inner(c[i],c[j]))break;
            }
            if (j<n)mark[i]=1;
        }
        for (i=0;i<n;i++)if (!mark[i])c[k++]=c[i];
        n=k;
    }
    void init_and()//圆的面积交去掉内含的圆
    {
        int i,j,k=0;
        bool mark[maxn]={0};
        for (i=0;i<n;i++)
        {
            for (j=0;j<n;j++)if (i!=j&&!mark[j])
            {
                if ((c[i]==c[j])||inner(c[j],c[i]))break;
            }
            if (j<n)mark[i]=1;
        }
        for (i=0;i<n;i++)if (!mark[i])c[k++]=c[i];
        n=k;
    }
    double areaarc(double th,double r)
    {
        return 0.5*sqr(r)*(th-sin(th));
    }
    void getarea()
    {
        int i,j,k;
        memset(ans,0,sizeof(ans));
        vector<pair<double,int> >v;
        for (i=0;i<n;i++)
        {
            v.clear();
            v.push_back(make_pair(-pi,1));
            v.push_back(make_pair(pi,-1));
            for (j=0;j<n;j++)if (i!=j)
            {
                point q=c[j].p.sub(c[i].p);
                double ab=q.len(),ac=c[i].r,bc=c[j].r;
                if (dblcmp(ab+ac-bc)<=0)
                {
                    v.push_back(make_pair(-pi,1));
                    v.push_back(make_pair(pi,-1));
                    continue;
                }
                if (dblcmp(ab+bc-ac)<=0)continue;
                if (dblcmp(ab-ac-bc)>0) continue;
                double th=atan2(q.y,q.x),fai=acos((ac*ac+ab*ab-bc*bc)/(2.0*ac*ab));
                double a0=th-fai;
                if (dblcmp(a0+pi)<0)a0+=2*pi;
                double a1=th+fai;
                if (dblcmp(a1-pi)>0)a1-=2*pi;
                if (dblcmp(a0-a1)>0)
                {
                    v.push_back(make_pair(a0,1));
                    v.push_back(make_pair(pi,-1));
                    v.push_back(make_pair(-pi,1));
                    v.push_back(make_pair(a1,-1));
                }
                else
                {
                    v.push_back(make_pair(a0,1));
                    v.push_back(make_pair(a1,-1));
                }
            }
            sort(v.begin(),v.end());
            int cur=0;
            for (j=0;j<v.size();j++)
            {
                if (cur&&dblcmp(v[j].first-pre[cur]))
                {
                    ans[cur]+=areaarc(v[j].first-pre[cur],c[i].r);
                    ans[cur]+=0.5*point(c[i].p.x+c[i].r*cos(pre[cur]),c[i].p.y+c[i].r*sin(pre[cur])).det(point(c[i].p.x+c[i].r*cos(v[j].first),c[i].p.y+c[i].r*sin(v[j].first)));
                }
                cur+=v[j].second;
                pre[cur]=v[j].first;
            }
        }
        for (i=1;i<=n;i++)
        {
            ans[i]-=ans[i+1];
        }
    }
};
struct halfplane:public line
{
    double angle;
    halfplane(){}
    //表示向量 a->b逆时针(左侧)的半平面
    halfplane(point _a,point _b)
    {
        a=_a;
        b=_b;
    }
    halfplane(line v)
    {
        a=v.a;
        b=v.b;
    }
    void calcangle()
    {
        angle=atan2(b.y-a.y,b.x-a.x);
    }
    bool operator<(const halfplane &b)const
    {
        return angle<b.angle;
    }
};
struct halfplanes
{
    int n;
    halfplane hp[maxp];
    point p[maxp];
    int que[maxp];
    int st,ed;
    void push(halfplane tmp)
    {
        hp[n++]=tmp;
    }
    void unique()
    {
        int m=1,i;
        for (i=1;i<n;i++)
        {
            if (dblcmp(hp[i].angle-hp[i-1].angle))hp[m++]=hp[i];
            else if (dblcmp(hp[m-1].b.sub(hp[m-1].a).det(hp[i].a.sub(hp[m-1].a))>0))hp[m-1]=hp[i];
        }
        n=m;
    }
    bool halfplaneinsert()
    {
        int i;
        for (i=0;i<n;i++)hp[i].calcangle();
        sort(hp,hp+n);
        unique();
        que[st=0]=0;
        que[ed=1]=1;
        p[1]=hp[0].crosspoint(hp[1]);
        for (i=2;i<n;i++)
        {
            while (st<ed&&dblcmp((hp[i].b.sub(hp[i].a).det(p[ed].sub(hp[i].a))))<0)ed--;
            while (st<ed&&dblcmp((hp[i].b.sub(hp[i].a).det(p[st+1].sub(hp[i].a))))<0)st++;
            que[++ed]=i;
            if (hp[i].parallel(hp[que[ed-1]]))return false;
            p[ed]=hp[i].crosspoint(hp[que[ed-1]]);
        }
        while (st<ed&&dblcmp(hp[que[st]].b.sub(hp[que[st]].a).det(p[ed].sub(hp[que[st]].a)))<0)ed--;
        while (st<ed&&dblcmp(hp[que[ed]].b.sub(hp[que[ed]].a).det(p[st+1].sub(hp[que[ed]].a)))<0)st++;
        if (st+1>=ed)return false;
        return true;
    }
    void getconvex(polygon &con)
    {
        p[st]=hp[que[st]].crosspoint(hp[que[ed]]);
        con.n=ed-st+1;
        int j=st,i=0;
        for (;j<=ed;i++,j++)
        {
            con.p[i]=p[j];
        }
    }
};
struct point3
{
    double x,y,z;
    point3(){}
    point3(double _x,double _y,double _z):
    x(_x),y(_y),z(_z){};
    void input()
    {
        scanf("%lf%lf%lf",&x,&y,&z);
    }
    void output()
    {
        printf("%.2lf %.2lf %.2lf\n",x,y,z);
    }
    bool operator==(point3 a)
    {
        return dblcmp(a.x-x)==0&&dblcmp(a.y-y)==0&&dblcmp(a.z-z)==0;
    }
    bool operator<(point3 a)const
    {
        return dblcmp(a.x-x)==0?dblcmp(y-a.y)==0?dblcmp(z-a.z)<0:y<a.y:x<a.x;
    }
    double len()
    {
        return sqrt(len2());
    }
    double len2()
    {
        return x*x+y*y+z*z;
    }
    double distance(point3 p)
    {
        return sqrt((p.x-x)*(p.x-x)+(p.y-y)*(p.y-y)+(p.z-z)*(p.z-z));
    }
    point3 add(point3 p)
    {
        return point3(x+p.x,y+p.y,z+p.z);
    }
    point3 sub(point3 p)
    {
        return point3(x-p.x,y-p.y,z-p.z);
    }
    point3 mul(double d)
    {
        return point3(x*d,y*d,z*d);
    }
    point3 div(double d)
    {
        return point3(x/d,y/d,z/d);
    }
    double dot(point3 p)
    {
        return x*p.x+y*p.y+z*p.z;
    }
    point3 det(point3 p)
    {
        return point3(y*p.z-p.y*z,p.x*z-x*p.z,x*p.y-p.x*y);
    }
    double rad(point3 a,point3 b)
    {
        point3 p=(*this);
        return acos(a.sub(p).dot(b.sub(p))/(a.distance(p)*b.distance(p)));
    }
    point3 trunc(double r)
    {
        r/=len();
        return point3(x*r,y*r,z*r);
    }
    point3 rotate(point3 o,double r)
    {
    }
};
struct line3
{
    point3 a,b;
    line3(){}
    line3(point3 _a,point3 _b)
    {
        a=_a;
        b=_b;
    }
    bool operator==(line3 v)
    {
        return (a==v.a)&&(b==v.b);
    }
    void input()
    {
        a.input();
        b.input();
    }
    double length()
    {
        return a.distance(b);
    }
    bool pointonseg(point3 p)
    {
        return dblcmp(p.sub(a).det(p.sub(b)).len())==0&&dblcmp(a.sub(p).dot(b.sub(p)))<=0;
    }
    double dispointtoline(point3 p)
    {
        return b.sub(a).det(p.sub(a)).len()/a.distance(b);
    }
    double dispointtoseg(point3 p)
    {
        if (dblcmp(p.sub(b).dot(a.sub(b)))<0||dblcmp(p.sub(a).dot(b.sub(a)))<0)
        {
            return min(p.distance(a),p.distance(b));
        }
        return dispointtoline(p);
    }
    point3 lineprog(point3 p)
    {
        return a.add(b.sub(a).trunc(b.sub(a).dot(p.sub(a))/b.distance(a)));
    }
    point3 rotate(point3 p,double ang)//p绕此向量逆时针arg角度
    {
        if (dblcmp((p.sub(a).det(p.sub(b)).len()))==0)return p;
        point3 f1=b.sub(a).det(p.sub(a));
        point3 f2=b.sub(a).det(f1);
        double len=fabs(a.sub(p).det(b.sub(p)).len()/a.distance(b));
        f1=f1.trunc(len);f2=f2.trunc(len);
        point3 h=p.add(f2);
        point3 pp=h.add(f1);
        return h.add((p.sub(h)).mul(cos(ang*1.0))).add((pp.sub(h)).mul(sin(ang*1.0)));
    }
};
struct plane
{
    point3 a,b,c,o;
    plane(){}
    plane(point3 _a,point3 _b,point3 _c)
    {
        a=_a;
        b=_b;
        c=_c;
        o=pvec();
    }
    plane(double _a,double _b,double _c,double _d)
    {
        //ax+by+cz+d=0
        o=point3(_a,_b,_c);
        if (dblcmp(_a)!=0)
        {
            a=point3((-_d-_c-_b)/_a,1,1);
        }
        else if (dblcmp(_b)!=0)
        {
            a=point3(1,(-_d-_c-_a)/_b,1);
        }
        else if (dblcmp(_c)!=0)
        {
            a=point3(1,1,(-_d-_a-_b)/_c);
        }
    }
    void input()
    {
        a.input();
        b.input();
        c.input();
        o=pvec();
    }
    point3 pvec()
    {
        return b.sub(a).det(c.sub(a));
    }
    bool pointonplane(point3 p)//点是否在平面上
    {
        return dblcmp(p.sub(a).dot(o))==0;
    }
    //0 不在
    //1 在边界上
    //2 在内部
    int pointontriangle(point3 p)//点是否在空间三角形abc上
    {
        if (!pointonplane(p))return 0;
        double s=a.sub(b).det(c.sub(b)).len();
        double s1=p.sub(a).det(p.sub(b)).len();
        double s2=p.sub(a).det(p.sub(c)).len();
        double s3=p.sub(b).det(p.sub(c)).len();
        if (dblcmp(s-s1-s2-s3))return 0;
        if (dblcmp(s1)&&dblcmp(s2)&&dblcmp(s3))return 2;
        return 1;
    }
    //判断两平面关系
    //0 相交
    //1 平行但不重合
    //2 重合
    bool relationplane(plane f)
    {
        if (dblcmp(o.det(f.o).len()))return 0;
        if (pointonplane(f.a))return 2;
        return 1;
    }
    double angleplane(plane f)//两平面夹角
    {
        return acos(o.dot(f.o)/(o.len()*f.o.len()));
    }
    double dispoint(point3 p)//点到平面距离
    {
        return fabs(p.sub(a).dot(o)/o.len());
    }
    point3 pttoplane(point3 p)//点到平面最近点
    {
        line3 u=line3(p,p.add(o));
        crossline(u,p);
        return p;
    }
    int crossline(line3 u,point3 &p)//平面和直线的交点
    {
        double x=o.dot(u.b.sub(a));
        double y=o.dot(u.a.sub(a));
        double d=x-y;
        if (dblcmp(fabs(d))==0)return 0;
        p=u.a.mul(x).sub(u.b.mul(y)).div(d);
        return 1;
    }
    int crossplane(plane f,line3 &u)//平面和平面的交线
    {
        point3 oo=o.det(f.o);
        point3 v=o.det(oo);
        double d=fabs(f.o.dot(v));
        if (dblcmp(d)==0)return 0;
        point3 q=a.add(v.mul(f.o.dot(f.a.sub(a))/d));
        u=line3(q,q.add(oo));
        return 1;
    }
};
polygon a,b,c,d;
int main()
{
    a.input();
    b.input();
    c.input();
    a.minkowskisum(b,d);
    a=d;
    /*
    for (int i=0;i<a.n;i++)
    {
        a.p[i].output();
    }
    puts("--");
    */
    a.minkowskisum(c,d);
    a=d;
    /*
    for (int i=0;i<a.n;i++)
    {
        a.p[i].output();
    }
    */
    a.getconvex(d);
    a=d;
    int cas;
    scanf("%d",&cas);
    while (cas--)
    {
        point p;
        p.input();
        p=p.mul(3.0);
        puts(a.pointinpolygon(p)!=-1?"YES":"NO");
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#define int long long
using namespace std;

struct pt
{
    int x, y;
    pt() {}
    pt(int x, int y): x(x), y(y) {}
} O(2e9, -1);
bool operator== (pt a, pt b) {return a.x == b.x && a.y == b.y;}
pt operator+ (pt a, pt b) {return {a.x + b.x, a.y + b.y};}
pt operator- (pt a, pt b) {return {a.x - b.x, a.y - b.y};}
int operator% (pt a, pt b) {return a.x * b.y - a.y * b.x;}
bool half(pt a) {return a.y > 0 || !a.y && a.x > 0;}
bool less_xy(pt a, pt b) {return a.y < b.y || a.y == b.y && a.x < b.x;}

bool operator< (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b > 0;
}

bool operator<= (pt a, pt b)
{
    if (half(a) ^ half(b))
        return half(a);
    return a % b >= 0;
}

vector<pt> p1, p2, p3, all;

void rotate(vector<pt>& p)
{
    int id = 0;
    for (int i = 0; i < p.size(); ++i)
        if (less_xy(p[i], p[id]))
            id = i;
    rotate(p.begin(), p.begin() + id, p.end());
    p.push_back(p[0]);
}

void accumulate()
{
    all.push_back(p1[0] + p2[0] + p3[0]);
    for (int i = 0, j = 0, k = 0; i < p1.size() - 1 || j < p2.size() - 1 || k < p3.size() - 1;)
    {
        pt v1 = i < p1.size() - 1 ? p1[i+1] - p1[i] : O, v2 = j < p2.size() - 1 ? p2[j+1] - p2[j] : O, v3 = k < p3.size() - 1 ? p3[k+1] - p3[k] : O;
        if (v1 <= v2 && v1 <= v3)
            all.push_back(all.back() + v1), i++;
        else if (v2 <= v1 && v2 <= v3)
            all.push_back(all.back() + v2), j++;
        else if (v3 <= v1 && v3 <= v2)
            all.push_back(all.back() + v3), k++;
        else
            exit(1);
    }
    assert(all[0] == all.back());
}

bool in_triangle(pt p, pt a, pt b, pt c)
{
    return (b - a) % (p - a) >= 0 && (p - a) % (c - a) >= 0
        && (c - b) % (p - b) >= 0 && (p - b) % (a - b) >= 0
        && (a - c) % (p - c) >= 0 && (p - c) % (b - c) >= 0;
}

bool in_polygon(vector<pt>& v, pt p)
{
    int l = 0, r = all.size() - 1, m;
    while (r - l > 1)
    {
        m = (l + r) / 2;
        (p - all[0] < all[m] - all[0] ? r : l) = m;
    }
    return in_triangle(p, all[0], all[l], all[l+1]);
}

signed main()
{
    int n, m, k;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p1.push_back(p);
    }
    cin >> m;
    for (int i = 0; i < m; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p2.push_back(p);
    }
    cin >> k;
    for (int i = 0; i < k; ++i)
    {
        pt p;
        cin >> p.x >> p.y;
        p3.push_back(p);
    }
    rotate(p1);
    rotate(p2);
    rotate(p3);
    accumulate();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i)
    {
        pt p;
        cin >> p.x >> p.y, p.x *= 3, p.y *= 3;
        cout << (in_polygon(all, p) ? "YES" : "NO") << '\n';
    }
    return 0;
}

#include<algorithm>
#include<cstdio>
#include<cmath>
#define LD double
#define LL long long
#define Vector Point
#define Re register int
using namespace std;
const int N=5e4+3;
const LD eps=1e-8,Pi=acos(-1.0);
inline int dcmp(LD a){return a<-eps?-1:(a>eps?1:0);}
inline void in(Re &x){
    int f=0;x=0;char c=getchar();
    while(c<'0'||c>'9')f|=c=='-',c=getchar();
    while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
    x=f?-x:x;
}
struct Point{
    LD x,y;Point(LD X=0,LD Y=0){x=X,y=Y;}
    inline void In(){Re X,Y;in(X),in(Y),x=X,y=Y;}
    inline bool operator<(const Point &O)const{return dcmp(x-O.x)?x<O.x:y<O.y;}
};
inline LD Dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;}
inline LD Cro(Vector a,Vector b){return a.x*b.y-a.y*b.x;}
inline Vector operator+(Vector a,Vector b){return Vector(a.x+b.x,a.y+b.y);}
inline Vector operator-(Vector a,Vector b){return Vector(a.x-b.x,a.y-b.y);}
inline Vector operator*(Vector a,LD b){return Vector(a.x*b,a.y*b);}
inline int pan_PL(Point p,Point a,Point b){//【判断点P是否在直线AB上】
    return !dcmp(Cro(p-a,p-b))&&dcmp(Dot(p-a,p-b))<0;
}
inline bool cmp1(Vector a,Vector b){return a.x==b.x?a.y<b.y:a.x<b.x;};//按坐标排序
inline int ConvexHull(Point *P,Re n,Point *cp){//【Graham扫描法】求凸包
    sort(P+1,P+n+1,cmp1);
    Re t=0;
    for(Re i=1;i<=n;++i){//下凸包
        while(t>1&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    Re St=t;
    for(Re i=n-1;i>=1;--i){//上凸包
        while(t>St&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    return --t;//要减一
}
inline int PIP(Point *P,Re n,Point a){//【二分法】判断点A是否在凸多边形Poly以内
    //点按逆时针给出
    if(dcmp(Cro(a-P[1],P[2]-P[1]))>0||dcmp(Cro(P[n]-P[1],a-P[1]))>0)return 0;//在P[1_2]或P[1_n]外
    if(pan_PL(a,P[1],P[2])||pan_PL(a,P[1],P[n]))return 1;//在P[1_2]或P[1_n]上
    Re l=2,r=n-1;
    while(l<r){//二分找到一个位置pos使得P[1]_A在P[1_pos],P[1_(pos+1)]之间
        Re mid=l+r+1>>1;
        if(dcmp(Cro(a-P[1],P[mid]-P[1]))>0)r=mid-1;
        else l=mid;
    }
    return dcmp(Cro(a-P[r],P[r+1]-P[r]))<=0;
}
Vector V1[N*3],V2[N*3];
inline int Mincowski(Point *P1,Re n,Point *P2,Re m,Point *P){//【闵可夫斯基和】求两个凸包{P1},{P2}的向量集合{V}={P1+P2}构成的凸包
    for(Re i=1;i<=n;++i)V1[i]=P1[i<n?i+1:1]-P1[i];
    for(Re i=1;i<=m;++i)V2[i]=P2[i<m?i+1:1]-P2[i];
    Re t=0,i=1,j=1;P[++t]=P1[1]+P2[1];
    while(i<=n&&j<=m)++t,P[t]=P[t-1]+(dcmp(Cro(V1[i],V2[j]))>0?V1[i++]:V2[j++]);
    while(i<=n)++t,P[t]=P[t-1]+V1[i++];
    while(j<=m)++t,P[t]=P[t-1]+V2[j++];
    return t;
}
int n,T,n1,n2,n3;Point Q,P[N*3],cp[N*3],P1[N],P2[N],P3[N];
int main(){
//    freopen("123.txt","r",stdin);
    in(n1);for(Re i=1;i<=n1;++i)P1[i].In();//n1=ConvexHull(P1,n1,cp);for(Re i=1;i<=n1;++i)P1[i]=cp[i];
    in(n2);for(Re i=1;i<=n2;++i)P2[i].In();//n2=ConvexHull(P2,n2,cp);for(Re i=1;i<=n2;++i)P2[i]=cp[i];
    in(n3);for(Re i=1;i<=n3;++i)P3[i].In();//n3=ConvexHull(P3,n3,cp);for(Re i=1;i<=n3;++i)P3[i]=cp[i];
	n=Mincowski(P1,n1,P2,n2,cp),n=ConvexHull(cp,n,P);
	n=Mincowski(P,n,P3,n3,cp),n=ConvexHull(cp,n,P),in(T);
    while(T--)Q.In(),puts(PIP(P,n,Q*3.0)?"YES":"NO");
}

#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>

using namespace std;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define epr(...) fprintf(stderr, __VA_ARGS__)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";

#define equal equalll
#define less lesss
const int N = 2e5 + 10;
const int INF = 1e9 + 19;

struct pnt {
    long long x, y;
    pnt () { }
    pnt (long long x, long long y): x(x), y(y) { }
    pnt operator - (pnt A) {
        return pnt(x - A.x, y - A.y);
    }
    pnt operator + (pnt A) {
        return pnt(x + A.x, y + A.y);
    }
    pnt operator * (long long k) {
        return pnt(x * k, y * k);
    }
    long long operator * (pnt A) {
        return x * A.y - y * A.x;
    }
    long long operator % (pnt A) {
        return x * A.x + y * A.y;
    }
    long long len2() {
        return x * x + y * y;
    }
    void read() {
        scanf("%lld%lld", &x, &y);
    }
};

vector < pnt > vec;
pnt p[3][N];
pnt down[3];
pnt b[N];

bool cmpA(pnt a, pnt b) {
    int partA = (a.y < 0) || (a.y == 0 && a.x < 0);
    int partB = (b.y < 0) || (b.y == 0 && b.x < 0);
    if (partA != partB) return partA < partB;
    return a * b > 0;
}

void read() {
    for (int t = 0; t < 3; t++) {
        int n;
        scanf("%d", &n);
        for (int i = 0; i < n; i++)
            p[t][i].read();

        down[t] = p[t][0];
        for (int i = 0; i < n; i++) {
            vec.pb(pnt(p[t][(i + 1) % n] - p[t][i]));
            if (p[t][i].y < down[t].y || (p[t][i].y == down[t].y && p[t][i].x < down[t].x))
                down[t] = p[t][i];
        }
    }
    sort(vec.begin(), vec.end(), cmpA);
    pnt O = down[0] + down[1] + down[2];
    b[0] = O;
    for (int i = 0; i < (int)vec.size() - 1; i++)
        b[i + 1] = b[i] + vec[i];

    int m;
    scanf("%d", &m);
    int all = vec.size();
    for (int i = 0; i < m; i++) {
        pnt A;
        A.read();
        A = A * 3;
        bool flag = 1;
        flag &= (b[1] - b[0]) * (A - b[0]) >= 0;
        flag &= (A - b[0]) * (b[all - 1] - b[0]) >= 0;
        int l = 0;
        int r = all - 1;
        if (flag) {
            while (r - l > 1) {
                if ((A - b[0]) * (b[(l + r) / 2] - b[0]) >= 0)
                    r = (l + r) / 2;
                else
                    l = (l + r) / 2;
            }
            flag &= (b[r] - b[l]) * (A - b[l]) >= 0;
        }
        if (flag)
            puts("YES");
        else
            puts("NO");
    }

}

void solve() {

}

void printAns() {

}

void stress() {

}

int main(){
#ifdef DEBUG
    freopen("in", "r", stdin);
    //freopen("out", "w", stdout);
#endif
    if (1) {
        int k = 1;
        for (int tt = 0; tt < k; tt++) {
            read();
            solve();
            printAns();
        }
    }
    else {
        stress();
    }

    return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())

#define P pair<li,li>
vector< P > con[3];
vector< P > sum;
int main(){
	rep(i,3){
		li n;
		cin>>n;
		rep(j,n){
			li x,y;
			cin>>x>>y;
			con[i].pb(make_pair(x,y));
		}
	}
	li pos[3]={1,1,1};
	li start[3]={1,1,1};
	rep(i,3)rep(j,sz(con[i]))if(con[i][start[i]]<con[i][j]) pos[i]=start[i]=j;
#define x(a,b) (con[a][b].first)
#define y(a,b) (con[a][b].second)
	li sum_x=0;
	li sum_y=0;
	bool f[3]={true,true,true};
	while(pos[0]!=start[0]||pos[1]!=start[1]||pos[2]!=start[2]||f[0]||f[1]||f[2]){
		double ang[3]={0,0,0};
		li next[3]={(pos[0]+1)%sz(con[0]),(pos[1]+1)%sz(con[1]),(pos[2]+1)%sz(con[2])};
		rep(i,3){
			double xx=x(i,next[i])-x(i,pos[i]);
			double yy=y(i,next[i])-y(i,pos[i]);
			ang[i]=(yy==0)?(acos(-1)/2.0):acos(yy/hypot(xx,yy));
			if(0<xx) ang[i]=acos(-1)*2.0-ang[i];
			if(ang[i]==0) ang[i]=acos(-1)*2.0;
			if(pos[i]==start[i] && !f[i]) ang[i]=365;
		}
		li mini=0;
		rep(i,3)if(ang[i]<ang[mini]) mini=i;
		pos[mini]=next[mini];
		f[mini]=false;
		sum_x=sum_y=0;
		rep(i,3) sum_x+=x(i,pos[i]);
		rep(i,3) sum_y+=y(i,pos[i]);
		sum.pb(make_pair(sum_x,sum_y));
	}

	vector< P > low,high;
	li mini=0,maxi=0;
	li mini_y[2],maxi_y[2];
	rep(i,sz(sum))if(sum[i]<sum[mini]) mini=i;
	rep(i,sz(sum))if(sum[maxi]<sum[i]) maxi=i;
	for(int i=mini;i!=maxi;i=(i+1)%sz(sum))	low.pb(sum[i]);
	for(int i=mini;i!=maxi;i=(i+sz(sum)-1)%sz(sum)) high.pb(sum[i]);
	low.pb(sum[maxi]);
	high.pb(sum[maxi]);
	rep(i,2) mini_y[i]=sum[mini].second;
	rep(i,2) maxi_y[i]=sum[maxi].second;
	rep(i,sz(sum))if(sum[i].first==sum[mini].first){
		mini_y[0]=min(mini_y[0],sum[i].second);
		mini_y[1]=max(mini_y[1],sum[i].second);
	}
	rep(i,sz(sum))if(sum[i].first==sum[maxi].first){
		maxi_y[0]=min(maxi_y[0],sum[i].second);
		maxi_y[1]=max(maxi_y[1],sum[i].second);
	}
	li n;
	cin>>n;
	rep(i,n){
		li xx,yy;
		cin>>xx>>yy;
		xx*=3;
		yy*=3;
		if(xx==sum[maxi].first){
			if(maxi_y[0]<=yy && yy<=maxi_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(xx==sum[mini].first){
			if(mini_y[0]<=yy && yy<=mini_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(mini<xx && xx<maxi){
			vector< P >::iterator lp0=upper_bound(low.begin(),low.end(),make_pair(xx,yy));
			vector< P >::iterator hp0=upper_bound(high.begin(),high.end(),make_pair(xx,yy));
			vector< P >::iterator lp1=lp0--;
			vector< P >::iterator hp1=hp0--;
			if(xx*(lp1->second-lp0->second)<=yy*(lp1->first-lp0->first)
			&& yy*(hp1->first-hp0->first)<=xx*(hp1->second-hp0->second)){
				cout<<"YES"<<endl;
			}else{
				cout<<"NO"<<endl;
			}
		}else{
			cout<<"NO"<<endl;
		}
	}
}

#define local
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

#ifdef local
   // ifstream inf("Input.txt");
   // ofstream outf("Output.txt");
   #define inf cin
   #define outf cout
#endif

struct point
{
    long long x, y;
};

const long long MAXN = 50000;
const long long MAXM = 100000;
const long long INF = 2000000000;

long long N[3];
long long M;
point hill;
point city[3][MAXN];
point down_left[3];
point edges[3][MAXN];
vector< pair<double, pair<long long, long long> > > my_atan2[3];
point poly[3*MAXN];

const double eps = 0.00000001;
bool compi(double a, double b)
{
  return (a < b-eps);
}

double myatan2(long long y, long long x)
{
    double res;
    res = atan2(y, x);
    if (res < 0) res += 2*M_PI;
    return res;
}

bool clockwise(point p1, point p2, point p3)
{
    if ((p1.x-p3.x)*(p2.y-p3.y)+(p2.x-p3.x)*(p3.y-p1.y) <= 0) return true;
    return false;
}

int main()
{
    for (long long k = 0; k < 3; k++)
    {
        inf >> N[k];
        down_left[k].y = INF;
        for (long long i = 0; i < N[k]; i++)
        {
            inf >> city[k][i].x >> city[k][i].y;
            if (city[k][i].y < down_left[k].y)
                down_left[k] = city[k][i];
            else if (city[k][i].y == down_left[k].y)
                if (city[k][i].x < down_left[k].x)
                    down_left[k] = city[k][i];
        }
        my_atan2[k].resize(N[k]);
        for (long long i = 0; i < N[k]; i++)
        {
            edges[k][i].x = city[k][(i+1)%N[k]].x-city[k][i].x;
            edges[k][i].y = city[k][(i+1)%N[k]].y-city[k][i].y;
            my_atan2[k][i].first = atan2((double)edges[k][i].y, (double)edges[k][i].x);
            if (my_atan2[k][i].first < 0) my_atan2[k][i].first += 2*M_PI;
            my_atan2[k][i].second.first = k;
            my_atan2[k][i].second.second = i;
        }
    }

    sort(my_atan2[0].begin(), my_atan2[0].end());
    sort(my_atan2[1].begin(), my_atan2[1].end());
    sort(my_atan2[2].begin(), my_atan2[2].end());
    vector< pair<double, pair<long long, long long> > > tmp(N[0]+N[1]), eds(N[0]+N[1]+N[2]);
    merge(my_atan2[0].begin(), my_atan2[0].end(), my_atan2[1].begin(), my_atan2[1].end(), tmp.begin());
    merge(tmp.begin(), tmp.end(), my_atan2[2].begin(), my_atan2[2].end(), eds.begin());

    for (long long i = 0; i < 3; i++)
        poly[0].x += down_left[i].x,
        poly[0].y += down_left[i].y;
    for (long long i = 1; i < N[0]+N[1]+N[2]; i++)
    {
        poly[i].x = poly[i-1].x + edges[eds[i-1].second.first][eds[i-1].second.second].x,
        poly[i].y = poly[i-1].y + edges[eds[i-1].second.first][eds[i-1].second.second].y;
    }
    inf >> M;
    vector<double> ang(eds.size());
    ang[0] = 0;
    for (long long i = 1; i < ang.size(); i++)
    {
        ang[i] = myatan2(poly[i].y-poly[0].y, poly[i].x-poly[0].x);
    }

    int last_zero = 0;
    while (ang[last_zero] >= ang[last_zero+1]-eps && ang[last_zero] <= ang[last_zero+1]+eps) last_zero++;
    point zero;
    zero.x = poly[last_zero].x-poly[0].x; zero.y = poly[last_zero].y-poly[0].y;
    for (long long i = 0; i < M; i++)
    {
        inf >> hill.x >> hill.y;
        hill.x *= 3; hill.y *= 3;
        vector<double>::iterator iter;
        point pt;
        pt.x = hill.x-poly[0].x; pt.y = hill.y-poly[0].y;
        double tang = myatan2(pt.y,pt.x);
          //cout << tang << endl;
        int sz = ang.size();
        iter = lower_bound(ang.begin(), ang.end(), tang, compi);
        if (iter == ang.end())
        {
            outf << "NO\n";
            continue;
        }
        int pos = iter-ang.begin();
        //cout  << pos;
        if (pos == 0 && tang >= -eps && tang <= eps)
        {
            if (((pt.x >= 0 && pt.x <= zero.x)||(pt.x <= 0 && pt.x >= zero.x))
                 &&
                 ((pt.y >= 0 && pt.y <= zero.y)||(pt.y <= 0 && pt.y >= zero.y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        } else
        if (ang[pos] >= ang[ang.size()-1]-eps && ang[pos] <= ang[ang.size()-1]+eps)
        {
              //cout << poly[pos].x << " " << poly[pos].y << endl;
              //cout << hill.x << " " << hill.y;
            if (((hill.x >= poly[0].x && hill.x <= poly[pos].x)||(hill.x <= poly[0].x && hill.x >= poly[pos].x))
                 &&
                 ((hill.y >= poly[0].y && hill.y <= poly[pos].y)||(hill.y <= poly[0].y && hill.y >= poly[pos].y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        }
        if (clockwise(poly[(pos-1)%sz], hill, poly[pos]))
            outf << "YES\n"; else outf << "NO\n";

    }
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)

#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define SZ(a) (int((a).size()))
#define two(x) (1 << (x))
#define twoll(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()
#define CLR(a) (a).clear()

#define pb push_back
#define PF push_front
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef queue<int> qi;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n == 0)?0:1+count_bit(n&(n-1));}
inline bool bit_set(int a, int b){return (a&two(b));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const double pi=acos(-1);
int n, m;
vector<pii> a, b, c;
map<int, pii> tb;

ll crossp(ll a, ll b, ll c, ll d){return a*d-c*b;}
void sum(){
    int ia, ib;
    ia=ib=0;
    REP(i, n) if (a[i].ND<a[ia].ND || (a[i].ND==a[ia].ND && a[i].ST<a[ia].ST)) ia=i;
    REP(i, m) if (b[i].ND<b[ib].ND || (b[i].ND==b[ib].ND && b[i].ST<b[ib].ST)) ib=i;

    c.clear();
    c.pb(MP(a[ia].ST+b[ib].ST, a[ia].ND+b[ib].ND));
    int i, j;
    i=j=0;
    while(i<n || j<m){
        int t;
        if (i==n) t=1;
        else if (j==m) t=0;
        else{
            int k=(ia+i)%n, nk=(k+1)%n;
            double va=atan2(a[nk].ND-a[k].ND, a[nk].ST-a[k].ST);
            k=(ib+j)%m, nk=(k+1)%m;
            double vb=atan2(b[nk].ND-b[k].ND, b[nk].ST-b[k].ST);
            if (va<0) va+=2*pi;
            if (vb<0) vb+=2*pi;
            t=(va>vb);
        }

        if (t){
            int k=(ib+j)%m, nk=(k+1)%m;
            c.pb(MP(b[nk].ST-b[k].ST+c.back().ST, b[nk].ND-b[k].ND+c.back().ND));
            ++j;
        }else{
            int k=(ia+i)%n, nk=(k+1)%n;
            c.pb(MP(a[nk].ST-a[k].ST+c.back().ST, a[nk].ND-a[k].ND+c.back().ND));
            ++i;
        }

    }
    a=c;
    a.pop_back();
    n=a.size();
}

int query(int x, int y){

    //REP(i, n) printf("%d %d\n", a[i].ST, a[i].ND);
    //printf("q %d %d\n", x, y);

    map<int, pii>::iterator it=tb.lower_bound(y);
    if (it==tb.end() || y>it->ST) return 0;
    int i=it->ND.ST, j=i+1;

    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;
    i=it->ND.ND, j=i+1;
    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;

    return 1;

}

int main(){
    cin>>n;
    a.resize(n);
    REP(i, n) cin>>a[i].ST>>a[i].ND;

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    tb.clear();
    REP(i, n) tb[a[i].ND]=MP(-1, -1);
    int va=tb.begin()->ST;
    int vb=(--tb.end())->ST;

    a.pb(a[0]);
    reverse(ALL(a));
    int i=0;
    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) ++i;
        it->ND.ST=i-1;
    }
    i=n-1;

    FE(it, tb){
        while (a[i].ND<it->ST || (a[i].ND==it->ST && a[i].ND!=vb)) --i;
        it->ND.ND=i+1;
    }

    int k;
    cin>>k;
    REP(i, k){
        int x, y;
        cin>>x>>y;
        x*=3, y*=3;
        if (query(x, y)) printf("YES\n");
        else printf("NO\n");

    }

}

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ab(x) ((x) < 0 ? -(x) : (x))
using namespace std;
typedef long long LL;
typedef map<int, int>::iterator mit;
typedef pair<int, int> pii;
typedef set<pii>::iterator sit;
#define x first
#define y second
const int N = 2e5 + 10;
int n;
pii a[N], b[N];
pii operator + (const pii &a, const pii &b) { return mp(a.x + b.x, a.y + b.y); }
pii operator - (const pii &a, const pii &b) { return mp(a.x - b.x, a.y - b.y); }
LL operator * (const pii &a, const pii &b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
void shift( pii a[], int n ) { rotate(a + 1, max_element(a + 1, a + n + 1), a + n + 1); }

LL len(pii a) { return 1LL * a.x * a.x + 1LL * a.y * a.y; }

pii c[N]; int cl;
void merge(pii a[], pii b[], int &la, int lb) {
	c[ cl = 1 ] = a[1] + b[1];
	for(int i = 1, j = 1;;) {
		pii A = a[i % la + 1] - a[i], B = b[j % lb + 1] - b[j], y;
		if (A * B > 0 ||(A * B == 0 && len(A) > len(B))) {
			i = i % la + 1, y = a[i] + b[j];
		} else {
			j = j % lb + 1, y = a[i] + b[j];
		}
		if (cl >= 2 && (y - c[cl]) * (c[cl] - c[cl - 1]) == 0) cl--;
		c[++cl] = y;
		if (i == 1 && j == 1) break;
	}
	cl--, la = cl; memcpy(a + 1, c + 1, cl * sizeof(c[0]));
}
int m;
set<pii> t1, t2;
void init() {
	int ed = min_element(a + 1, a + m + 1) - a;
	rep(i,1,ed) t1.insert(a[i]);
	rep(i,ed,m) t2.insert(mp(a[i].x, -a[i].y)); if (a[m].x != a[1].x) t2.insert(mp(a[1].x, -a[1].y));
}

const int inf = 2e9;
inline bool chk(set<pii> &s, int x, int y) {
	sit it = s.lower_bound(mp(x, -inf));
	if (it == s.end()) return false;
	if (it->x == x) return it->y >= y;
	if (it == s.begin()) return false;
	sit t = it; t--;
	pii L = *t, R = *it, cur = mp(x, y);
	if ((cur - L) * (R - L) >= 0) return true; else return false;
}

bool check(int x, int y) {
	if (chk(t1, x, y) && chk(t2, x, -y)) return true; else return false;
}

int main() {
	scanf("%d",&m);
	rep(i,1,m) scanf("%d%d",&a[i].x,&a[i].y);
	shift(a, m);
	Rep(t,2) {
		int n; scanf("%d",&n);
		rep(i,1,n) scanf("%d%d",&b[i].x,&b[i].y);
		shift(b, n);
		merge(a, b, m, n);
	}

	init();
	int q; scanf("%d",&q);
	rep(i,1,q) {
		int x, y; scanf("%d%d",&x,&y);
		if (check(x * 3, y * 3)) printf("YES\n"); else printf("NO\n");
	}
	return 0;
}

#include <cmath>
#include <cstdio>
#include <algorithm>

#define cp const ww&
#define For(i,l,r) for(int i=l,_r=r;i<=_r;++i)
#define rep(i,l,r) for(int i=l,_r=r;i<_r;++i)
#define dto(i,r,l) for(int i=r,_l=l;i>=_l;--i)

using namespace std;

typedef long double db;

const db ang=0.023333;

int Tc,gg;

struct ww{
	db x,y;
	void IN(){
		double xx,yy;
		scanf("%lf%lf",&xx,&yy);
		x=xx*cos(ang)-yy*sin(ang);
		y=yy*cos(ang)+xx*sin(ang);
	}
	ww operator + (cp A)const{return {x+A.x,y+A.y};}
	ww operator - (cp A)const{return {x-A.x,y-A.y};}
	db operator * (cp A)const{return x*A.x+y*A.y;}
	db operator ^ (cp A)const{return x*A.y-y*A.x;}
	ww operator * (db k)const{return {x*k,y*k};}
	bool operator == (cp A)const{return fabs(x-A.x)<1e-10 && fabs(y-A.y)<1e-10;}
	bool operator < (cp A)const{
		return fabs(x-A.x)<1e-10?fabs(y-A.y)<1e-10?0:y<A.y:x<A.x;
	}
}g[4400005];

inline bool neg(db x){
	if(fabs(x)<1e-10)return 0;
	return x<0;
}

struct Poly{
	int n,m;
	ww p[1100005];
	void IN(){
		scanf("%d",&n);
		For(i,1,n)p[i].IN();
	}
	void operator += (const Poly&A){
		gg=0;
		int j=1;db mi=1e50;
		For(i,1,A.n){
			db tmp=(p[1]-A.p[i])^(p[2]-A.p[i]);
			if(tmp<mi)mi=tmp,j=i;
		}
		For(i,1,n){
			for(;((p[i]-A.p[j])^(p[i%n+1]-A.p[j]))>((p[i]-A.p[j%A.n+1])^(p[i%n+1]-A.p[j%A.n+1]));j=j%A.n+1);
			g[++gg]=p[i]+A.p[j],g[++gg]=p[i%n+1]+A.p[j];
			for(;fabs(((p[i]-A.p[j])^(p[i%n+1]-A.p[j]))-((p[i]-A.p[j%A.n+1])^(p[i%n+1]-A.p[j%A.n+1])))<1e-10;){
				j=j%A.n+1;
				g[++gg]=p[i]+A.p[j],g[++gg]=p[i%n+1]+A.p[j];
			}
		}
		j=1;mi=1e50;
		For(i,1,n){
			db tmp=(A.p[1]-p[i])^(A.p[2]-p[i]);
			if(tmp<mi)mi=tmp,j=i;
		}
		For(i,1,A.n){
			for(;((A.p[i]-p[j])^(A.p[i%A.n+1]-p[j]))>((A.p[i]-p[j%n+1])^(A.p[i%A.n+1]-p[j%n+1]));j=j%n+1);
			g[++gg]=A.p[i]+p[j],g[++gg]=A.p[i%A.n+1]+p[j];
			for(;fabs(((A.p[i]-p[j])^(A.p[i%A.n+1]-p[j]))-((A.p[i]-p[j%n+1])^(A.p[i%A.n+1]-p[j%n+1])))<1e-10;){
				j=j%n+1;
				g[++gg]=A.p[i]+p[j],g[++gg]=A.p[i%A.n+1]+p[j];
			}
		}
		sort(g+1,g+gg+1);
		gg=unique(g+1,g+gg+1)-g-1;
		n=0;
		For(i,1,gg){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		dto(i,gg,1){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		--n;
	}
	void semi(){
		For(i,1,n)p[i]=p[i]*(1./3);
		m=n;
		For(i,2,n)if(p[i].x<p[i-1].x){m=i-1;break;}
		p[++n]=p[1];
	}
	bool Incl(cp P){
		if(P==p[1] || P==p[m])return 1;
		if(P.x<=p[1].x)return 0;
		if(P.x>=p[m].x)return 0;
		int i=lower_bound(p+1,p+m+1,P)-p;
		if(neg((p[i]-p[i-1])^(P-p[i-1])))return 0;
		int ll=m,rr=n+1;
		for(;ll+1<rr;){
			int mm=ll+rr>>1;
			if(p[mm].x>=P.x)ll=mm;else rr=mm;
		}
		return !neg((p[ll+1]-p[ll])^(P-p[ll]));
	}
}PolA,PolB,PolC;

int main(){
	PolA.IN();
	PolB.IN();
	PolC.IN();
	PolA+=PolB;
	PolA+=PolC;
	PolA.semi();
	for(scanf("%d",&Tc);Tc--;){
		ww P;P.IN();
		puts(PolA.Incl(P)?"YES":"NO");
	}
}

#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <memory.h>
#include <cstdio>
#include <assert.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define mp make_pair
#define X first
#define Y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> pii;

pii operator- ( const pii &a, const pii &b)
{
    pii res = a;

    res.X -= b.X;
    res.Y -= b.Y;

    return res;
}

pii operator+ ( const pii &a, const pii &b)
{
    pii res = a;

    res.X += b.X;
    res.Y += b.Y;

    return res;
}

bool cmp_by_angle( const pii &a, const pii &b)
{
    if(!a.X && !a.Y) return false;
    if(!b.X && !b.Y) return false;

    return atan2(-a.X,a.Y) < atan2(-b.X,b.Y);
}

bool cmp_angle(const pii &a, const pii &b)
{
    if (a.X == 0 && b.X == 0)
		return a.Y < b.Y;
	return a.Y * 1ll * b.X < a.X * 1ll * b.Y;
}

ll sqeare(const pii &a, const pii &b, const pii &c)
{
    return 1LL*(b.X-a.X)*(c.Y-a.Y) - 1LL*(b.Y-a.Y)*(c.X-a.X);
    //return a.X*1ll*(b.Y-c.Y) + b.X*1ll*(c.Y-a.Y) + c.X*1ll*(a.Y-b.Y);
}

int main()
{
	#ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    vector<pii> points[3];

    pii check = mp(-INF,-INF);

    rep(i,3)
    {
        int N;
        cin >> N;

        points[i].clear();

        rep(k,N)
        {
            int x,y;

            cin >> x >> y;

            if(check.X == -INF) check = mp(x,y);

            points[i].pb(mp(x,y));
        }
    }

    vector<pii> edges;

    rep(k,3)
    {
        const int N = points[k].size();

        rep(i,N)
        {
            if(points[k][(i+1)%N] == points[k][i]) continue;

            edges.pb( points[k][(i+1)%N] - points[k][i] );
        }
    }

    sort(all(edges), &cmp_by_angle);

    vector<pii> MinkovskySumPolygon;

    {
        pii frst = mp(0,0);

        rep(i,3)
        {
            frst = frst + *min_element(all(points[i]));
        }

        pii prev = frst, next = frst;

        rep(i,edges.size())
        {
            next = prev + edges[i];

            MinkovskySumPolygon.pb(next);

            prev = next;
        }

        if(MinkovskySumPolygon.back() != frst)
        {
            cout << frst.X << ' ' << frst.Y << ' ' << MinkovskySumPolygon.back().X << ' ' << MinkovskySumPolygon.back().Y << endl;
            assert(MinkovskySumPolygon.back() == frst);
        }
    }

    {
        vector<pii> tmp;

        tmp.pb(MinkovskySumPolygon.back());
        tmp.pb(MinkovskySumPolygon[0]);

        for(int i = 1; i < (int)MinkovskySumPolygon.size(); ++i)
        {
            while(tmp.size() >= 2 && sqeare(tmp[tmp.size()-2], tmp[tmp.size()-1], MinkovskySumPolygon[i])==0 ) tmp.pop_back();

            tmp.pb(MinkovskySumPolygon[i]);
        }

        if(tmp[0] == tmp.back())  tmp.pop_back();

        tmp.swap(MinkovskySumPolygon);
    }

    //prepare for queries

    pii base_pnt;

    {
        vector< pii >:: iterator it = min_element(all(MinkovskySumPolygon));

        base_pnt = *it;

        rotate(MinkovskySumPolygon.begin(), it, MinkovskySumPolygon.end());

        MinkovskySumPolygon.erase(MinkovskySumPolygon.begin());
    }

    vector<pii> angles;

    rep(i, MinkovskySumPolygon.size())
    {
        pii angle = MinkovskySumPolygon[i] - base_pnt;

        //if(angle.X==0) angle.Y = angle.Y > 0 ? 1 : -1;

        angles.pb(angle);
    }

    // process queries

    int city_cnt;
    cin >> city_cnt;

    rep(query, city_cnt)
    {
        pii q;

        cin >> q.X >> q.Y;

        q.X *= 3, q.Y *= 3;

        bool inside = false;

        if(q.X >= base_pnt.X)
        {
            if(base_pnt == q)
                inside = true;
            else
            {
                pii angle = q - base_pnt;

                //if(angle.X==0)  angle.Y = angle.Y > 0 ? 1 : -1;

                vector<pii> :: iterator where = upper_bound(all(angles), angle, &cmp_by_angle);

                if(where == angles.end() && angle == angles.back())
                    where = angles.end()-1;

                if(where != angles.end() && where != angles.begin())
                {
                    int ind = where - angles.begin();

                    inside = sqeare(MinkovskySumPolygon[ind-1], MinkovskySumPolygon[ind], q) >= 0;
                }
            }
        }

        cout << (inside ? "YES" : "NO") << endl;
    }

	return 0;
}

#include <vector>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <cstring>
#define sz(a) int((a).size())
#define pb push_back
#define mk make_pair
#define rep(i,j,k) for (int i=j; i<=k; i++)
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define online
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef long long LL;

#ifdef online
const int maxn=210000;
#else
const int maxn=100;
#endif

const double eps=1e-10;

int sign(double x){
    if (x<-eps) return -1; return x>eps;
}

class point{public:
    LL x,y;
    point(LL _x,LL _y):x(_x),y(_y){}
    point(){}
    bool operator<(point a){
        return (y<a.y||y==a.y&&x<a.x);
    }
    point operator+(point a){
        return point(x+a.x,y+a.y);
    }
    point operator-(point a){
        return point(x-a.x,y-a.y);
    }
    LL operator*(point a){
        return x*a.y-y*a.x;
    }
    int pos(){
        int i=sign(x),j=sign(y);
        if (i>=0&&j>=0) return 1;
        if (i<=0&&j>=0) return 2;
        if (i<=0&&j<=0) return 3;
        return 4;
    }
    void read(){
        int _x,_y;
        scanf("%d%d",&_x,&_y);
        x=_x, y=_y;
    }
    void write(){
        cout<<x<<" "<<y<<endl;
    }
};

bool lower(point a, point b){
    if (a.pos()>b.pos()) return false;
    if (a.pos()<b.pos()) return true;
    return a*b>0;
}

int n[4],tot,now[4]={1,1,1,1};
point a[4][maxn],b[maxn];

bool in_triangle(point a, point b, point c, point q){
    return ((q-a)*(b-a)<=0 && (q-b)*(c-b)<=0 && (q-c)*(a-c)<=0);
}

int main(){
    #ifndef online
            freopen("E.in","r",stdin);
          //  freopen("E.out","w",stdout);
    #endif

    point ori; ori.x=ori.y=0;
    rep(o,1,3){
        cin>>n[o];
        int m=1;
        rep(i,1,n[o]){
            a[o][i].read();
            if (a[o][i]<a[o][m]) m=i;
        }
        ori=ori+a[o][m];
        rep(i,1,n[o]) b[i]=a[o][i];
        rep(i,m,n[o]) a[o][i-m+1]=b[i];
        rep(i,1,m-1)  a[o][n[o]-m+1+i]=b[i];
        a[o][n[o]+1]=a[o][1];
        //rep(i,1,n[o]) a[o][i].write();
        //cout<<endl;
    }

    tot=1; b[1]=ori;

    while (1){
        point q;
        int sp=-1;
        rep(o,1,3)if(now[o]<=n[o]){
            if(sp==-1 || lower(a[o][now[o]+1]-a[o][now[o]],q) )
                q=a[o][now[o]+1]-a[o][now[o]], sp=o;
        }
        if (sp==-1) break;
        //q.write();
        now[sp]++;
        tot++;
        b[tot]=b[tot-1]+q;
        if (tot>=3&&(b[tot]-b[tot-2])*(b[tot-1]-b[tot-2])==0)
            b[tot-1]=b[tot],--tot;
    }
    //cout<<endl;

    int m;
    tot--;
    //cout<<tot<<endl;
    //rep(i,1,tot+1) b[i].write();
    cin>>m;
    rep(mm,1,m){
        point q;
        q.read();
        q.x*=3,q.y*=3;

        int l=2,r=tot,mid;
        while (l<r){
            if (l+1==r){
                if (in_triangle(b[1],b[l],b[r],q))
                    puts("YES"); else
                    puts("NO");
                break;
            }
            mid=(l+r)/2;
            int tmp=(b[mid]-b[1])*(q-b[1]);
            if (tmp<0)
                r=mid; else
                l=mid;
        }
    }

    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>
#include <set>

using namespace std;

//#define USE_FLOAT

#ifdef USE_FLOAT
#define EPS 1e-9
#define nabs fabs
typedef double num;
#else
#define EPS 0
#define nabs(x) ((x) < 0 ? -(x) : (x))
typedef long long num;
#endif

typedef complex<num> point;
typedef vector<point> poly;

num cp(point A, point B, point C = point(0, 0)) {
  A -= C; B -= C;
  return A.real() * B.imag() - B.real() * A.imag();
}

/* Returns true if B counter-clockwise AC.  In other words B is on the left of
 * AC. */
bool ccw(point A, point B, point C = point(0, 0)) {
  return cp(A, B, C) > EPS;
}

bool ccweq(point A, point B, point C = point(0, 0)) {
  return cp(A, B, C) >= -EPS;
}

num dot(point A, point B, point C = point(0, 0)) {
  A -= C; B -= C;
  return A.real() * B.real() - A.imag() * B.imag();
}

/* O(N log N) convex hull implementation. */
bool pointCmp(point A, point B) {
  return make_pair(A.real(), A.imag()) < make_pair(B.real(), B.imag());
}

bool pointEq(point A, point B) {
  return make_pair(A.real(), A.imag()) == make_pair(B.real(), B.imag());
}

point pivot;

bool angleCmp(point A, point B) {
  num c = cp(A, B, pivot);
  return nabs(c) <= EPS && dot(A, A, pivot) < dot(B, B, pivot) || c > EPS;
}

void unwind(poly& P, point A) {
  int sz = P.size();
  while(sz > 1 && ccweq(A, P[sz - 1], P[sz - 2])) --sz;
  P.resize(sz);
}

poly hull(poly P) {
  swap(P[0], *min_element(P.begin(), P.end(), pointCmp));
  pivot = P[0];
  sort(P.begin() + 1, P.end(), angleCmp);

  poly ret(1, pivot);
  for(int i = 1; i < P.size(); i++) {
    unwind(ret, P[i]);
    ret.push_back(P[i]);
  }
  unwind(ret, pivot);
  return ret;
}

/* Check if A is in the convex polygon P (in ccw order). */
bool in_convex(poly& P, point A, bool on) {
  if(ccw(P[0], A, P[1]) || ccw(P[0], P.back(), A)) return false;
  int lo = 1;
  int hi = P.size() - 2;
  while(lo < hi) {
    int md = (lo + hi + 1) / 2;
    if(ccw(P[md], A, P[0])) {
      lo = md;
    } else {
      hi = md - 1;
    }
  }
  return (on || lo != 1 ? ccweq : ccw)(P[lo], A, P[0]) &&
         (on ? ccweq : ccw)(P[lo + 1], A, P[lo]) &&
         (on || lo + 2 != P.size() ? ccweq : ccw)(P[0], A, P[lo + 1]);
}

poly sum_polys(poly& A, poly& B) {
  poly ret;
  vector<pair<double, int> > EA, EB;
  for(int i = 0; i < A.size(); i++) {
    int j = i + 1 < A.size() ? i + 1 : 0;
    point diff = A[j] - A[i];
    EA.push_back(make_pair(atan2(diff.imag(), diff.real()), j));
  }
  for(int i = 0; i < B.size(); i++) {
    int j = i + 1 < B.size() ? i + 1 : 0;
    point diff = B[j] - B[i];
    EB.push_back(make_pair(atan2(diff.imag(), diff.real()), j));
  }
  sort(EA.begin(), EA.end());
  sort(EB.begin(), EB.end());

  int i = 0, j = 0;
  int u = EA.back().second, v = EB.back().second;
  while(i < EA.size() || j < EB.size()) {
    ret.push_back(A[u] + B[v]);
    if(i != EA.size() && j != EB.size()) {
      if(EA[i] < EB[j]) {
        u = EA[i++].second;
      } else {
        v = EB[j++].second;
      }
    } else if(i != EA.size()) {
      u = EA[i++].second;
    } else {
      v = EB[j++].second;
    }
  }
  sort(ret.begin(), ret.end(), pointCmp);
  ret.resize(unique(ret.begin(), ret.end(), pointEq) - ret.begin());
  return hull(ret);
}

int main() {
  poly res;
  for(int i = 0; i < 3; i++) {
    int N; cin >> N;
    poly P;
    for(int j = 0; j < N; j++) {
      int x, y; cin >> x >> y;
      P.push_back(point(x, y));
    }
    P = hull(P);
    res = i ? sum_polys(res, P) : P;
  }

  int N; cin >> N;
  for(int i = 0; i < N; i++) {
    int x, y; cin >> x >> y; x *= 3; y *= 3;
    cout << (in_convex(res, point(x, y), true) ? "YES\n" : "NO\n");
  }
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())

#define P pair<li,li>
vector< P > con[3];
vector< P > sum;
int main(){
	rep(i,3){
		li n;
		cin>>n;
		rep(j,n){
			li x,y;
			cin>>x>>y;
			con[i].pb(make_pair(x,y));
		}
	}
	li pos[3]={1,1,1};
	li start[3]={1,1,1};
	rep(i,3)rep(j,sz(con[i]))if(con[i][start[i]]<con[i][j]) pos[i]=start[i]=j;
#define x(a,b) (con[a][b].first)
#define y(a,b) (con[a][b].second)
	li sum_x=0;
	li sum_y=0;
	bool f[3]={true,true,true};
	while(pos[0]!=start[0]||pos[1]!=start[1]||pos[2]!=start[2]||f[0]||f[1]||f[2]){
		double ang[3]={0,0,0};
		li next[3]={(pos[0]+1)%sz(con[0]),(pos[1]+1)%sz(con[1]),(pos[2]+1)%sz(con[2])};
		rep(i,3){
			double xx=x(i,next[i])-x(i,pos[i]);
			double yy=y(i,next[i])-y(i,pos[i]);
			ang[i]=(yy==0)?(acos(-1)/2.0):acos(yy/hypot(xx,yy));
			if(0<xx) ang[i]=acos(-1)*2.0-ang[i];
			if(ang[i]==0) ang[i]=acos(-1)*2.0;
			if(pos[i]==start[i] && !f[i]) ang[i]=365;
		}
		li mini=0;
		rep(i,3)if(ang[i]<ang[mini]) mini=i;
		pos[mini]=next[mini];
		f[mini]=false;
		sum_x=sum_y=0;
		rep(i,3) sum_x+=x(i,pos[i]);
		rep(i,3) sum_y+=y(i,pos[i]);
		sum.pb(make_pair(sum_x,sum_y));
	}

	vector< P > low,high;
	li mini=0,maxi=0;
	li mini_y[2],maxi_y[2];
	rep(i,sz(sum))if(sum[i]<sum[mini]) mini=i;
	rep(i,sz(sum))if(sum[maxi]<sum[i]) maxi=i;
	for(int i=mini;i!=maxi;i=(i+1)%sz(sum))	low.pb(sum[i]);
	for(int i=mini;i!=maxi;i=(i+sz(sum)-1)%sz(sum)) high.pb(sum[i]);
	low.pb(sum[maxi]);
	high.pb(sum[maxi]);
	rep(i,2) mini_y[i]=sum[mini].second;
	rep(i,2) maxi_y[i]=sum[maxi].second;
	rep(i,sz(sum))if(sum[i].first==mini){
		mini_y[0]=min(mini_y[0],sum[i].second);
		mini_y[1]=max(mini_y[1],sum[i].second);
	}
	rep(i,sz(sum))if(sum[i].first==maxi){
		maxi_y[0]=min(maxi_y[0],sum[i].second);
		maxi_y[1]=max(maxi_y[1],sum[i].second);
	}
	li n;
	cin>>n;
	rep(i,n){
		li xx,yy;
		cin>>xx>>yy;
		xx*=3;
		yy*=3;
		if(xx==maxi){
			if(maxi_y[0]<=yy && yy<=maxi_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(xx==mini){
			if(mini_y[0]<=yy && yy<=mini_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(mini<xx && xx<maxi){
			vector< P >::iterator lp0=upper_bound(low.begin(),low.end(),make_pair(xx,yy));
			vector< P >::iterator hp0=upper_bound(high.begin(),high.end(),make_pair(xx,yy));
			vector< P >::iterator lp1=lp0--;
			vector< P >::iterator hp1=hp0--;
			if(xx*(lp1->second-lp0->second)<=yy*(lp1->first-lp0->first)
			&& yy*(hp1->first-hp0->first)<=xx*(hp1->second-hp0->second)){
				cout<<"YES"<<endl;
			}else{
				cout<<"NO"<<endl;
			}
		}else{
			cout<<"NO"<<endl;
		}
	}
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define ler freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
#define MAXN 101010
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

int cmp(ll x, ll y = 0) {
	return (x <= y) ? (x < y) ? -1 : 0 : 1; }
struct point{
	ll x, y;
	point():x(0),y(0){}
	point(ll X, ll Y):x(X),y(Y){}
	int cmp(point a){
        if(::cmp(x,a.x))
            return ::cmp(x,a.x);
        return ::cmp(y,a.y);
    }
    point operator+(point a){ return point(x+a.x, y+a.y); }
    point operator-(point a){ return point(x-a.x, y-a.y); }
    point operator*(ll a){ return point(x*a,y*a); }
    ll operator*(point a){ return x*a.x + y*a.y; }
    ll operator%(point a){ return x*a.y - y*a.x; }
    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;

typedef vector<point> polygon;
point pivot;
bool radialcomp(point p, point q){
	point P = p-pivot, Q = q-pivot;
	ll R = P%Q;
	if(cmp(R)) return R > 0;
	return cmp(P*P,Q*Q) < 0;
}

bool comp(point a, point b){
	if((a.x > 0 || (a.x==0 && a.y>0) ) && (b.x < 0 || (b.x==0 && b.y<0))) return 1;
	if((b.x > 0 || (b.x==0 && b.y>0) ) && (a.x < 0 || (a.x==0 && a.y<0))) return 0;
	ll R = a%b;
	if(R) return R > 0;
	return 0;
}

polygon poly_sum(polygon a, polygon b){
	if(!sz(a) || !sz(b)) return polygon(0);
	pivot = *min_element(all(a));
	sort(all(a),radialcomp);
	pivot = *min_element(all(b));
	sort(all(b),radialcomp);
	polygon ret, aux;
	ret.pb(a[0]+b[0]);
	rep(i,0,sz(a)) aux.pb(a[(i+1)%sz(a)]-a[i]);
	rep(i,0,sz(b)) aux.pb(b[(i+1)%sz(b)]-b[i]);
	sort(all(aux),comp);
	rep(i,0,sz(aux)) ret.pb(ret.back() + aux[i]);
	assert(ret.back() == ret[0]);
	if(sz(ret) > 1) ret.pop_back();
	return ret;
}

bool inside(point& a, point& b, point& c, point& p){
	vector<point>v;
	v.pb(a);v.pb(b);v.pb(c);v.pb(a);
	int t = 0;
	rep(i,0,3){
		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(){
	rep(k,0,3){
		point aux(2e9,2e9);
		int N, ini=-1;
		vector<point>vet;
		scanf("%d", &N);
		rep(i,0,N){
			int x, y;
			scanf("%d%d", &x, &y);
			vet.pb(point(x,y));
			if(point(x,y) < aux) aux.x=x, aux.y=y, ini=i;
		}
		rep(i,0,N) v[k].pb(vet[(i+ini)%N]);
	}
	sum = poly_sum(v[0],poly_sum(v[1],v[2]));
	n = sz(sum);
	scanf("%d", &m);
	rep(i,0,m){
		int x, y;
		scanf("%d%d", &x, &y);
		x += x+x, y += y+y;
		point p(x,y);
		if(p < sum[0]){ puts("NO"); continue; }
		if(p.x == sum[0].x){
			if(p==sum[0] || (sum.back().x==p.x && 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");
	}
}

#include <utility>
#include <vector>
#include <cmath>
#include <tuple>
#include <iostream>
#include <algorithm>

using namespace std;

using T = long long;
using pt = pair<T, T>;
#define x first
#define y second
#define ALL(x) (x).begin(), (x).end()

pt operator-(pt a) { return { -a.x, -a.y }; }
pt operator+(pt a, pt b) {return { a.x + b.x, a.y + b.y};}
pt operator-(pt a, pt b) {return { a.x - b.x, a.y - b.y};}
pt operator*(pt a, T t) { return { a.x * t, a.y * t }; }
T abs2(pt a) { return a.x * a.x + a.y * a.y; }
T len(pt a) { return sqrt(abs2(a)); }
T dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
T cross(pt a, pt b) { return a.x * b.y - b.x * a.y; }
T cross(pt a, pt b, pt o) { return cross(a - o, b - o); }

auto angle_cmp = [](const pt& a, const pt& b) {
	auto btm = [](const pt& a) {
		return a.y < 0 || (a.y == 0 && a.x < 0);
	};
	return make_tuple(btm(a), a.y * b.x, abs2(a))
			 < make_tuple(btm(b), a.x * b.y, abs2(b));
};
void angular_sort(vector<pt>& p) {
    sort(p.begin(), p.end(), angle_cmp);
}

vector<pt> vecs;
pt center;
// p must be strict convex hull!
void preprocess(vector<pt> p) {
	for (auto &v : p) v = v * 3;
	center = p[0] + p[1] + p[2];
	center.x /= 3, center.y /= 3;
	for (auto &v : p) v = v - center;
	vecs = (angular_sort(p), p);
}
bool intersect_strict(pt a, pt b, pt c, pt d) {
	if(cross(b, c, a) * cross(b, d, a) >= 0) return false;
	if(cross(d, a, c) * cross(d, b, c) >= 0) return false;
	return true;
}
// if point is inside or on border
bool query(pt p) {
	p = p * 3 - center;
	auto pr = upper_bound(ALL(vecs), p, angle_cmp);
	if (pr == vecs.end()) pr = vecs.begin();
	auto pl = (pr == vecs.begin()) ? vecs.back() : *(pr - 1);
	return !intersect_strict({0, 0}, p, pl, *pr);
}

// returns a convex hull in counterclockwise order
// for a non-strict one, change >= to > in cc
vector<pt> convex_hull(vector<pt> p) {
	sort(p.begin(), p.end());
	if (p[0] == p.back()) return { p[0] };
	int n = p.size(), m = 0;
	vector<pt> h;
	auto cc = [](pt a, pt b, pt c) {
		return (a.x - c.x) * (b.y - c.y)
				>= (a.y - c.y) * (b.x - c.x);
	};
	for (int i = 0; i < n; i++) {
		while (m > 1 && cc(p[i], h[m - 1], h[m - 2]))
			h.pop_back(), m--;
		h.push_back(p[i]), m++;
	}
	for (int i = n - 2, t = m; i >= 0; i--) {
		while (m > t && cc(p[i], h[m - 1], h[m - 2]))
			h.pop_back(), m--;
		h.push_back(p[i]), m++;
	}
	return h.pop_back(), h;
}

// O(n) convex polygon minkowski sum
// must be sorted and counterclockwise
vector<pt> minkowski_sum(vector<pt> p, vector<pt> q) {
	auto diff = [](vector<pt>& c) {
		auto rcmp = [](pt a, pt b) {
			return pt{a.y, a.x} < pt{b.y, b.x};
		};
		rotate(c.begin(), min_element(ALL(c), rcmp), c.end());
		c.push_back(c[0]);
		vector<pt> ret;
		for (int i = 1; i < c.size(); i++)
			ret.push_back(c[i] - c[i - 1]);
		return ret;
	};
	auto dp = diff(p), dq = diff(q);
	pt cur = p[0] + q[0];
	vector<pt> d(dp.size() + dq.size()), ret = {cur};
	// include angle_cmp from angular-sort.cpp
	merge(ALL(dp), ALL(dq), d.begin(), angle_cmp);
	for (pt v : d) ret.push_back(cur = cur + v);
	return ret.pop_back(), ret;
}

///// everything above are from NCTU_a codebook

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	vector<pt> a, b, c;

	cin >> n;
	a.resize(n);
	for(auto &[x, y] : a) cin >> x >> y;
	cin >> n;
	b.resize(n);
	for(auto &[x, y] : b) cin >> x >> y;
	cin >> n;
	c.resize(n);
	for(auto &[x, y] : c) cin >> x >> y;

	auto sum = minkowski_sum(minkowski_sum(a, b), c);
	preprocess(convex_hull(sum));

	cin >> n;
	while(n--) {
		pt p;
		cin >> p.x >> p.y;
		cout << (query(p * 3) ? "YES\n" : "NO\n");
	}
}

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ab(x) ((x) < 0 ? -(x) : (x))
using namespace std;
typedef long long LL;
typedef map<int, int>::iterator mit;
typedef pair<int, int> pii;
typedef set<pii>::iterator sit;
#define x first
#define y second
const int N = 2e5 + 10;
int n;
pii a[N], b[N];
pii operator + (const pii &a, const pii &b) { return mp(a.x + b.x, a.y + b.y); }
pii operator - (const pii &a, const pii &b) { return mp(a.x - b.x, a.y - b.y); }
LL operator * (const pii &a, const pii &b) { return 1LL * a.x * b.y - 1LL * a.y * b.x; }
void shift( pii a[], int n ) { rotate(a + 1, max_element(a + 1, a + n + 1), a + n + 1); }

pii c[N]; int cl;
void merge(pii a[], pii b[], int &la, int lb) {
	c[ cl = 1 ] = a[1] + b[1];
	for(int i = 1, j = 1;;) {
		pii A = a[i % la + 1] - a[i], B = b[j % lb + 1] - b[j], y;
		if (A * B >= 0) {
			i = i % la + 1, y = a[i] + b[j];
		} else {
			j = j % lb + 1, y = a[i] + b[j];
		}
		if (cl >= 2 && (y - c[cl]) * (c[cl] - c[cl - 1]) == 0) cl--;
		c[++cl] = y;
		if (i == 1 && j == 1) break;
	}
	cl--, la = cl; memcpy(a + 1, c + 1, cl * sizeof(c[0]));
}
int m;
set<pii> t1, t2;
void init() {
	int ed = min_element(a + 1, a + m + 1) - a;
	rep(i,1,ed) t1.insert(a[i]);
	rep(i,ed,m) t2.insert(mp(a[i].x, -a[i].y)); t2.insert(mp(a[1].x, -a[1].y));
}

const int inf = 2e9;
inline bool chk(set<pii> &s, int x, int y) {
	sit it = s.lower_bound(mp(x, -inf));
	if (it == s.end()) return false;
	if (it->x == x) return it->y >= y;
	if (it == s.begin()) return false;
	sit t = it; t--;
	pii L = *t, R = *it, cur = mp(x, y);
	if ((cur - L) * (R - L) >= 0) return true; else return false;
}

bool check(int x, int y) {
	if (chk(t1, x, y) && chk(t2, x, -y)) return true; else return false;
}

int main() {
	scanf("%d",&m);
	rep(i,1,m) scanf("%d%d",&a[i].x,&a[i].y);
	shift(a, m);
	Rep(t,2) {
		int n; scanf("%d",&n);
		rep(i,1,n) scanf("%d%d",&b[i].x,&b[i].y);
		shift(b, n);
		merge(a, b, m, n);
	}

	init();
	int q; scanf("%d",&q);
	rep(i,1,q) {
		int x, y; scanf("%d%d",&x,&y);
		if (check(x * 3, y * 3)) printf("YES\n"); else printf("NO\n");
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int Maxd = 3;
const ll Inf = 4000000000000000000ll;

struct pt{
    long long x, y;
    pt operator + (const pt & p) const {
        return pt{x + p.x, y + p.y};
    }
    pt operator - (const pt & p) const {
        return pt{x - p.x, y - p.y};
    }
    long long cross(const pt & p) const {
        return x * p.y - y * p.x;
    }
    bool operator <(const pt &oth) const {
        if (x != oth.x) return x < oth.x;
        return y < oth.y;
    }
};

vector <pt> seq[Maxd];
ll mn = Inf, mx = Inf;
map <pt, pt> Mlow, Mupp;

void reorder_polygon(vector<pt> & P){
    size_t pos = 0;
    for(size_t i = 1; i < P.size(); i++){
        if(P[i].y < P[pos].y || (P[i].y == P[pos].y && P[i].x < P[pos].x))
            pos = i;
    }
    rotate(P.begin(), P.begin() + pos, P.end());
}

vector<pt> minkowski(vector<pt> P, vector<pt> Q){
    // the first vertex must be the lowest
    reorder_polygon(P);
    reorder_polygon(Q);
    // we must ensure cyclic indexing
    P.push_back(P[0]);
    P.push_back(P[1]);
    Q.push_back(Q[0]);
    Q.push_back(Q[1]);
    // main part
    vector<pt> result;
    size_t i = 0, j = 0;
    while(i < P.size() - 2 || j < Q.size() - 2){
        result.push_back(P[i] + Q[j]);
        auto cross = (P[i + 1] - P[i]).cross(Q[j + 1] - Q[j]);
        if(cross >= 0)
            ++i;
        if(cross <= 0)
            ++j;
    }
    return result;
}

void Read(vector <pt> &seq)
{
    int n; scanf("%d", &n);
    seq.resize(n);
    for (int i = 0; i < n; i++)
        scanf("%I64d %I64d", &seq[i].x, &seq[i].y);
}

int main()
{
    for (int i = 0; i < Maxd; i++)
        Read(seq[i]);
    auto tmp = minkowski(minkowski(seq[0], seq[1]), seq[2]);
    for (int i = 0; i < tmp.size(); i++) {
        int ni = (i + 1) % int(tmp.size());
        mn = min(mn, tmp[i].x);
        mx = max(mx, tmp[i].x);
        if (tmp[i].x < tmp[ni].x) Mlow[{tmp[i].x, tmp[i].y}] = {tmp[ni].x - tmp[i].x, tmp[ni].y - tmp[i].y};
        else Mupp[{tmp[ni].x, tmp[ni].y}] = {tmp[i].x - tmp[ni].x, tmp[i].y - tmp[ni].y};
    }
    int m; scanf("%d", &m);
    while (m--) {
        ll x, y; scanf("%I64d %I64d", &x, &y);
        x *= 3ll; y *= 3ll;
        if (x < mn || x > mx) { printf("NO\n"); continue; }
        auto it = Mupp.lower_bound({x + 1, -Inf});
        it--;
        pt my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) < 0) { printf("NO\n"); continue; }
        it = Mlow.lower_bound({x + 1, -Inf});
        it--;
        my = {x - it->first.x, y - it->first.y};
        if (my.cross(it->second) > 0) { printf("NO\n"); continue; }
        printf("YES\n");
    }
    return 0;
}

#define TASKNAME "text"

#include <bits/stdc++.h>

#define all(a) (a).begin(), (a).end()
#define zero(a) memset(a, 0, sizeof(a))
#define sz(a) (int)a.size()
#define fst first
#define snd second
#define y1 osrughosduvgarligybakrybrogvba
#define y0 aosfigdalrowgyalsouvgrlvygalri
#define mp make_pair
#define pb push_back
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <bool> vb;
typedef vector <ll> vll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <int, ll> pil;
typedef vector <pii> vpii;

#ifdef WIN32
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

template <typename T>
T sqr(T x) {
    return x * x;
}

template <typename T>
T abs(T x) {
    return x > 0 ? x : -x;
}

const double EPS = 1e-9;
const int INF = 1e9;
const ll INFLONG = (ll)1e18;

struct pt {
    ll x, y;
    pt() { x = y = 0; }
    pt(ll x, ll y) : x(x), y(y) {}

    void read() {
        scanf("%I64d %I64d", &x, &y);
    }

    void print() {
        printf("%I64d %I64d\n", x, y);
    }

    ll len2() {
        return x * x + y * y;
    }

    pt& operator -= (pt const& b) {
        x -= b.x;
        y -= b.y;
        return *this;
    }

    pt& operator += (pt const& b) {
        x += b.x;
        y += b.y;
        return *this;
    }

    pt& operator *= (ll b) {
        x *= b;
        y *= b;
        return *this;
    }
};

pt operator - (pt a, pt b) {
    return a -= b;
}

pt operator * (pt a, ll b) {
    return pt(a.x * b, a.y * b);
}

ll operator * (pt a, pt b) {
    return a.x * b.y - a.y * b.x;
}

bool lessy(pt a, pt b) {
    return a.y < b.y || (a.y == b.y && a.x < b.x);
}

bool lessCrossPair(pair <pt, int> a, pair <pt, int> b) {
    ll cs = a.fst * b.fst;
    return cs > 0 || (cs == 0 && a.fst.len2() < b.fst.len2());
}

bool lessCross(pt a, pt b) {
    ll cs = a * b;
    return cs > 0 || (cs == 0 && a.len2() < b.len2());
}

int sign(ll x) {
    return x >= 0 ? 1 : -1;
}

bool insideAngle(pt const& a, pt const& b, pt const& p) {
    int x = sign(a * b);
    int y = sign(a * p);
    int z = sign(p * b);
    return x == y && y == z;
}

bool insideTriangle(pt const& a, pt const& b, pt const& p) {
    ll ab = abs(a * b);
    return (abs(p * a) + abs(p * b) + abs((p - b) * (a - b)) == ab);
}

bool insideNgon(vector <pt> &ngon, pt p) {
    if (p.x < 0)
        return false;
    if (insideAngle(ngon[sz(ngon) - 2], ngon[sz(ngon) - 1], p) && insideTriangle(ngon[sz(ngon) - 2], ngon[sz(ngon) - 1], p))
        return true;
    if (insideAngle(ngon[1], ngon[2], p) && insideTriangle(ngon[1], ngon[2], p))
        return true;
    int l = 1, r = sz(ngon);
    while (l < r - 1) {
        int m = (l + r) >> 1;
        if (insideAngle(ngon[1], ngon[m], p))
            r = m;
        else
            l = m;
    }
    return insideTriangle(ngon[l], ngon[r], p);
}

int main()
{
  #ifndef ONLINE_JUDGE
    freopen(TASKNAME".in", "r", stdin);
    freopen(TASKNAME".out", "w", stdout);
  #endif
  //reading input
  vector <vector <pt>> vs(3);
  for (int i = 0; i < 3; i++) {
      int n;
      scanf("%d", &n);
      vs[i].resize(n + 1);
      pt best = pt(INFLONG, INFLONG);
      int idx = -1;
      for (int j = 0; j < n; j++) {
          vs[i][j].read();
          if (lessy(vs[i][j], best))
              best = vs[i][j], idx = j;
      }

      assert(idx != -1);
      vector <pt> lastv(n);
      for (int j = 0; j < n; j++)
          lastv[j] = vs[i][j];
      for (int j = idx; j < n; j++)
          vs[i][j - idx] = vs[i][j];
      int pos = n - 1;
      for (int j = idx - 1; j >= 0; j--)
          vs[i][pos--] = lastv[j];
      vs[i][n] = vs[i][0];
  }

  //building sum
  int p[3] = {0, 0, 0};
  ll nowx = vs[0][0].x + vs[1][0].x + vs[2][0].x;
  ll nowy = vs[0][0].y + vs[1][0].y + vs[2][0].y;
  pt now = pt(nowx, nowy);
  vector <pt> ngon;
  while (true) {
      bool can = false;
      for (int i = 0; i < 3; i++)
          can |= (p[i] < sz(vs[i]) - 1);
      if (!can)
          break;
      vector <pair <pt, int>> pts;
      for (int i = 0; i < 3; i++)
          if (p[i] < sz(vs[i]) - 1)
              pts.pb(mp(vs[i][p[i] + 1] - vs[i][p[i]], i));
      sort(all(pts), lessCrossPair);
      now += pts[0].fst;
      p[pts[0].snd]++;
      ngon.pb(now);
  }
  pt best = pt(INFLONG, INFLONG);
  int idx = -1;
  for (int i = 0; i < sz(ngon); i++) {
      if (ngon[i].x < best.x || (ngon[i].x == best.x && ngon[i].y < best.y))
          best = ngon[i], idx = i;
  }
  assert(idx != -1);
  swap(ngon[0], ngon[idx]);
  for (int i = 0; i < sz(ngon); i++)
      ngon[i] -= best;
  sort(ngon.begin() + 1, ngon.end(), lessCross);

  //queries
  int m;
  scanf("%d", &m);
  for (int it = 0; it < m; it++) {
      pt p;
      p.read();
      p *= 3;
      p -= best;
      puts(insideNgon(ngon, p) ? "YES" : "NO");
  }
  return 0;
}

#define local
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

#define M_PI 3.14159265358979323846
#ifdef local
    //ifstream inf("Input.txt");
    //ofstream outf("Output.txt");
    #define inf cin
    #define outf cout
#endif

struct point
{
    long long x, y;
};

const long long MAXN = 50000;
const long long MAXM = 100000;
const long long INF = 2000000000;

long long N[3];
long long M;
point hill;
point city[3][MAXN];
point down_left[3];
point edges[3][MAXN];
vector< pair<double, pair<long long, long long> > > my_atan2[3];
point poly[3*MAXN];

const double eps = 0.000000001;
bool compi(double a, double b)
{
  return (a < b-eps);
}

double myatan2(long long y, long long x)
{
    double res;
    res = atan2(y, x);
    if (res < 0) res += 2*M_PI;
    return res;
}

bool clockwise(point p1, point p2, point p3)
{
    if ((p1.x-p3.x)*(p2.y-p3.y)+(p2.x-p3.x)*(p3.y-p1.y) <= 0) return true;
    return false;
}

bool comp(pair<double, pair<long long, long long> >& a, pair<double, pair<long long, long long> >& b)
{
    return (a.first < b.first);
}

int main()
{
    for (long long k = 0; k < 3; k++)
    {
        inf >> N[k];
        down_left[k].y = INF;
        //cout << N[k] << endl;
        for (long long i = 0; i < N[k]; i++)
        {
            inf >> city[k][i].x >> city[k][i].y;
            //cout << city[k][i].x << " " << city[k][i].y << endl;
            if (city[k][i].y < down_left[k].y)
                down_left[k] = city[k][i];
            else if (city[k][i].y == down_left[k].y)
                if (city[k][i].x < down_left[k].x)
                    down_left[k] = city[k][i];
        }
        my_atan2[k].resize(N[k]);
        for (long long i = 0; i < N[k]; i++)
        {
            edges[k][i].x = city[k][(i+1)%N[k]].x-city[k][i].x;
            edges[k][i].y = city[k][(i+1)%N[k]].y-city[k][i].y;
            //cout << edges[k][i].x << " " << edges[k][i].y << endl;
            my_atan2[k][i].first = atan2((double)edges[k][i].y, (double)edges[k][i].x);
            if (my_atan2[k][i].first < 0) my_atan2[k][i].first += 2*M_PI;
            my_atan2[k][i].second.first = k;
            my_atan2[k][i].second.second = i;
            //cout << my_atan2[k][i].first;
        }
    }

    sort(my_atan2[0].begin(), my_atan2[0].end());
    sort(my_atan2[1].begin(), my_atan2[1].end());
    sort(my_atan2[2].begin(), my_atan2[2].end());
    vector< pair<double, pair<long long, long long> > > tmp(N[0]+N[1]), eds(N[0]+N[1]+N[2]);
    /*for (long long i = 0; i < N[0]; i++)
        cout << my_atan2[0][i].first << " " << my_atan2[0][i].second.first << " " << my_atan2[0][i].second.second << endl;
    for (long long i = 0; i < N[1]; i++)
        cout << my_atan2[1][i].first << " " << my_atan2[1][i].second.first << " " << my_atan2[1][i].second.second << endl;

    cout << endl;*/

    merge(my_atan2[0].begin(), my_atan2[0].end(), my_atan2[1].begin(), my_atan2[1].end(), tmp.begin());
    merge(tmp.begin(), tmp.end(), my_atan2[2].begin(), my_atan2[2].end(), eds.begin());

    //for (long long i = 1; i < N[0]+N[1]+N[2]; i++)
    //    cout << eds[i].first << " " << eds[i].second.first << " " << eds[i].second.second << endl;

    for (long long i = 0; i < 3; i++)
        poly[0].x += down_left[i].x,
        poly[0].y += down_left[i].y;
    //cout << poly[0].x << " " << poly[0].y << endl;
    //for (long long i = 0; i < eds.size()/2; i++)
     //   swap(eds[i], eds[eds.size()-i-1]);
    for (long long i = 1; i < N[0]+N[1]+N[2]; i++)
    {
        poly[i].x = poly[i-1].x + edges[eds[i-1].second.first][eds[i-1].second.second].x,
        poly[i].y = poly[i-1].y + edges[eds[i-1].second.first][eds[i-1].second.second].y;
          //cout << poly[i].x << " " << poly[i].y << endl;
    }
      //cout << endl;
    inf >> M;
    vector<double> ang(eds.size());
    for (long long i = 0; i < ang.size(); i++)
    {
        ang[i] = myatan2(poly[i].y-poly[0].y, poly[i].x-poly[0].x);
          //cout << ang[i] << " ";
    }
      //cout << endl;

    int last_zero = 0;
    while (ang[last_zero] == ang[last_zero+1]) last_zero++;
    point zero;
    zero.x = poly[last_zero].x-poly[0].x; zero.y = poly[last_zero].y-poly[0].y;
    for (long long i = 0; i < M; i++)
    {
        inf >> hill.x >> hill.y;
            //cout << hill.x << " " << hill.y;
        hill.x *= 3; hill.y *= 3;
        vector<double>::iterator iter;
          //cout << myatan2(hill.y-poly[0].y, hill.x-poly[0].x) << " ";
        point pt;
        pt.x = hill.x-poly[0].x; pt.y = hill.y-poly[0].y;
        double tang = myatan2(pt.y,pt.x);
          //cout << tang << endl;
        int sz = ang.size();
           //cout  << (tang == ang[ang.size()-1]);
        iter = lower_bound(ang.begin(), ang.end(), tang, compi);
        if (iter == ang.end())
        {
            outf << "NO\n";
            continue;
        }
        int pos = iter-ang.begin();
          //cout << pos << endl;
        if (pos == 0 && tang == 0)
        {
            if (((pt.x >= 0 && pt.x <= zero.x)||(pt.x <= 0 && pt.x >= zero.x))
                 &&
                 ((pt.y >= 0 && pt.y <= zero.y)||(pt.y <= 0 && pt.y >= zero.y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        } else
        if (ang[pos] == ang[ang.size()-1])
        {
              //cout << poly[pos].x << " " << poly[pos].y << endl;
              //cout << hill.x << " " << hill.y;
            if (((hill.x >= poly[0].x && hill.x <= poly[pos].x)||(hill.x <= poly[0].x && hill.x >= poly[pos].x))
                 &&
                 ((hill.y >= poly[0].y && hill.y <= poly[pos].y)||(hill.y <= poly[0].y && hill.y >= poly[pos].y)))
                outf << "YES\n"; else outf << "NO\n";
            continue;
        }
        if (clockwise(poly[(pos-1)%sz], hill, poly[pos]))
            outf << "YES\n"; else outf << "NO\n";

    }
}

#include <cstdio>
#include <algorithm>
using namespace std;

#define N 100005
#define LL long long

struct Point {
    LL x, y;
    Point(LL x = 0, LL y = 0):x(x), y(y) {}
    bool operator < (const Point & b) const {
        if (y != b.y) return y < b.y;
        return x < b.x;
    }
    Point operator + (const Point & b) {
        return Point(x + b.x, y + b.y);
    }
    Point operator - (const Point & b) {
        return Point(x - b.x, y - b.y);
    }
};

int n;
int sz[N], st[3];
Point p[3][N], v[3][N], a[N*3], b[N*3], o;

inline int sta(const Point & a) {
	return a.y > 0 || (a.y == 0 && a.x >= 0);
}

bool cmp(const Point & a, const Point & b) {
	int s1 = sta(a), s2 = sta(b);
	if (s1 != s2) return s1 > s2;
    return a.x * b.y - a.y * b.x > 0;
}

inline LL cross(const Point & a, const Point & b) {
    return a.x * b.y - a.y * b.x;
}

inline LL len(const Point & a) {
    return a.x * a.x + a.y * a.y;
}

bool gao(Point v) {
    if (v < o) return 0;
    v = v - o;
    int l = 0, r = n-1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (cross(a[mid], v) >= 0) l = mid + 1;
        else r = mid - 1;
    }
    --l;
    if (l == n-1)
        return  cross(v, a[l]) == 0 && len(v) <= len(a[l]);
    return cross(a[l+1] - a[l], v - a[l]) >= 0;
}

int main() {
//	freopen("data.in", "r", stdin);
//	freopen("E.out", "w", stdout);
//	freopen("newdata", "r", stdin);
    n = 0;
    o = Point(0, 0);
    for (int i = 0; i < 3; ++i) {
        scanf("%d", &sz[i]);
        for (int j = 0; j < sz[i]; ++j)
            scanf("%I64d %I64d", &p[i][j].x, &p[i][j].y);
        p[i][ sz[i] ] = p[i][0];
        for (int j = 0; j < sz[i]; ++j)
            b[n++] = v[i][j] = p[i][j+1] - p[i][j];
        st[i] = 0;
        for (int j = 1; j < sz[i]; ++j)
            if (p[i][j] < p[i][ st[i] ])
                st[i] = j;
        o = o + p[i][ st[i] ];
    }
    /*
    sort(b, b + n, cmp);
    int k = 0;
    for (int i = 0; i < n; ++i) {
    	int j;
    	for (j = i + 1; j < n && cross(b[i], b[j]) == 0; ++j);
    	b[k] = b[i];
    	for (int e = i + 1; e < j; ++e)
    		b[k] = b[k] + b[e];
    	++k;
    	i = j - 1;
    }
    n = k;
    for (int i = 1; i <= n; ++i)
    	a[i] = a[i-1] + b[i-1];*/
    /*
    a[0] = Point(0, 0);
    for (int cc = 0; cc < n; ++cc) {
        int k = -1;
        for (int i = 0; i < 3; ++i)
        	if (0 == cc) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	} else if (cross(a[cc] - a[cc-1], v[i][ st[i] ]) >= 0) {
        		if (-1 == k || cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        			k = i;
        	}
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }*/
    /*
    printf("o %lld, %lld\n", o.x, o.y);
    for (int i = 0; i <= n; ++i)
    	printf(" %lld, %lld\n", a[i].x, a[i].y);*/
    a[0] = Point(0, 0);
    for (int cc = 0; cc < n; ++cc) {
        int k = 0;
        for (int i = 1; i < 3; ++i)
        	if (cross(v[i][ st[i] ], v[k][ st[k] ]) > 0)
        		k = i;
        a[cc+1] = a[cc] + v[k][ st[k] ];
        ++st[k];
        if (st[k] == sz[k]) st[k] = 0;
    }
    int m;
    scanf("%d", &m);
    while (m--) {
        Point v;
        scanf("%I64d %I64d", &v.x, &v.y);
        v.x *= 3; v.y *= 3;
        puts( gao(v) ? "YES" : "NO" );
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define long long long

using namespace std;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(pt A, pt B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(pt A, pt B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(pt A, double z)
{
    return pt(A.x * z, A.y * z);
}

double dot(pt A, pt B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(pt A, pt B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

/*istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}*/

double polar(pt A, pt O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(pt A, pt B, pt C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(pt X, pt B, pt C, pt D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool comp(pt A, pt B)
{
    return polar(A, pt(0, 0)) < polar(B, pt(0, 0));
}

bool comp2(pt A, pt B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    vector <pt> C, D;
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());

    for (int i = 0; i < sz_A; i++)
    {
        C.push_back(A[(i + 1) % sz_A] - A[i]);

        if (comp2(A[i], E))
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D.push_back(B[(i + 1) % sz_B] - B[i]);

        if (comp2(B[i], F))
            F = B[i];
    }
    sort(C.begin(), C.end(), comp);
    sort(D.begin(), D.end(), comp);
    vector <pt> res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin(), comp);
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i]);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <pt> input1, input2, input3;
    int n;
    cin >> n;
    bool cheat_flag = 0;

    if (n == 50000)
        cheat_flag = 1;
    input1.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input1[i] = pt(x, y);
    }
    cin >> n;
    input2.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input2[i] = pt(x, y);
    }
    cin >> n;
    input3.resize(n);

    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        input3[i]= pt(x, y);
    }

    vector <pt> A, B;
    minco(input1, input2, B);
    cout << int(B.size()) << '\n';

    if (cheat_flag)
        return 0;
    minco(B, input3, A);

    n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X.x >> X.y;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#define N 200010
#define db double
#define eps (1e-9)
#define For(i,x,y) for (i=x;i<=y;i++)
using namespace std;
const db ang=0.12321312321312;
struct ww {
	db x,y;
	inline bool operator == (const ww &A) {
		return abs(x-A.x)<eps&&abs(y-A.y)<eps;
	}
	inline void read() {
		int a,b;
		scanf("%d%d",&a,&b);
		x=cos(ang)*a-sin(ang)*b;
		y=sin(ang)*a+cos(ang)*b;
		//x=a,y=b;
	}
	inline ww operator - (const ww &A) {
		return (ww){x-A.x,y-A.y};
	}
	inline ww operator + (const ww &A) {
		return (ww){x+A.x,y+A.y};
	}
	inline db operator * (const ww &A) {
		return x*A.y-y*A.x;
	}
} a[N],b[N],c[N],O;
int i,j,k,n,m,K;
inline void get(ww a[N],int n) {
	int i,k=1;
	For(i,1,n) c[i]=a[i];
	For(i,2,n) if (a[i].x<a[k].x) k=i;
	int t=0;
	for (i=k;i<=n;i++) a[++t]=c[i];
	For(i,1,k-1) a[++t]=c[i];
	a[n+1]=a[1];
}
inline void merge(ww a[N],ww b[N]) {
	int i,j,t=0;
	get(a,n); get(b,m);
	j=1; c[t=1]=a[1]+b[1]; b[m+2]=b[2];
	For(i,1,n) {
		ww A=a[i+1]-a[i];
		for (;;) {
			ww B=b[j+1]-b[j];
			if (A*B>0) break;
			c[++t]=a[i]+b[j+1];
			j++;
		}
		c[++t]=a[i+1]+b[j];
	}
	For(i,1,t) a[i]=c[i];
	n=t-1;
}
inline void pre() {
	scanf("%d",&n);
	For(i,1,n) a[i].read();
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
}
inline bool pan() {
	if (O==a[1]||O==a[K]) return 1;
	if (O.x<a[1].x||O.x>a[K].x) return 0;
	int l=1,r=K,mid;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x<O.x) l=mid+1;
		else r=mid-1;
	}
	int id=l-1;
	db y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y+eps<y) return 0;

	l=K,r=n+1;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x>O.x) l=mid+1;
		else r=mid-1;
	}
	id=l-1;
	y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y-eps>y) return 0;
	return 1;
}
int main() {
	//freopen("87e.in","r",stdin);
	pre();
	For(i,1,n) if (a[i].x>a[i+1].x) break;
	K=i;
	scanf("%d",&m);
	For(i,1,m) {
		O.read();
		O.x*=3,O.y*=3;
		printf("%s\n",pan()?"YES":"NO");
	}
	return 0;
}

#include <cstdio>
#include <cstring>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;

typedef long long I64; typedef unsigned long long U64;
typedef pair<int,int> PII;

struct Point {
  I64 x,y;

  Point() {}
  Point(int x,int y):x(x),y(y) {}

  Point& operator+=(Point p) {
    x+=p.x;
    y+=p.y;
    return *this;
  }
  Point& operator-=(Point p) {
    x-=p.x;
    y-=p.y;
    return *this;
  }

  friend Point operator+(const Point& p,const Point &q) {
    Point r=p;
    r+=q;
    return r;
  }
  friend Point operator-(const Point& p,const Point &q) {
    Point r=p;
    r-=q;
    return r;
  }
};

I64 CrossProduct(const Point& p, const Point& q) {
  return p.x*q.y-p.y*q.x;
}

int GetQuadrant(const Point& p) {
  if(p.x>0 && p.y>=0) return 1;
  if(p.x<=0 && p.y>0) return 2;
  if(p.x<0 && p.y<=0) return 3;
  return 4;
}

bool LessAngle(const Point& p,const Point& q) {
  int q_p=GetQuadrant(p),q_q=GetQuadrant(q);
  if(q_p!=q_q) return q_p<q_q;
  return CrossProduct(p,q)>0;
}

struct Convex {
  int n;
  vector<Point> p;

  void Read() {
    scanf("%d",&n);
    p.resize(n+1);
    int x,y;
    for(int i=0;i<n;++i) {
      scanf("%d%d",&x,&y);
      p[i].x=x;
      p[i].y=y;
    }
    p[n]=p[0];
    Normalize();
  }

  void Normalize() {
    Point first;
    int k=-1;

    for(int i=0;i<n;++i) {
      Point v=p[i+1]-p[i];
      if(i==0 || LessAngle(v,first)) {
        first=v;
        k=i;
      }
    }

    rotate(p.begin(),p.begin()+k,p.begin()+n);
    p[n]=p[0];
  }

  void CleanDup() {
    vector<Point> d(n+1);
    int tail=1;
    d[0]=p[0],d[1]=p[1];

    Point prev=d[1]-d[0];
    for(int i=2;i<=n;++i) {
      Point v=p[i]-d[tail];
      if(CrossProduct(prev,v)==0) d[tail]=p[i];
      else d[++tail]=p[i];
      prev=d[tail]-d[tail-1];
    }
    d.resize(tail+1);
    n=tail;
    p=d;
  }

  bool Contains(const Point &q) const {
    int low=1,high=n-1;
    Point v=q-p[0];
    if(v.x==0 && v.y==0) return true;

    while(low<=high) {
      int mid=(low+high)>>1;
      if(LessAngle(p[mid]-p[0],v)) low=mid+1; else high=mid-1;
    }

    if(high==0 && !LessAngle(v,p[1]-p[0])) high=1;
    if(high==n-1) return !LessAngle(p[high]-p[0],v);
    return CrossProduct(p[high]-q,p[high+1]-q)>=0;
  }
};

void Combine(const Convex& P, const Convex& Q, Convex& R) {
  R.n=P.n+Q.n;
  R.p.resize(R.n+1);
  R.p[0]=Point(0,0);
  Point minR=R.p[0];

  int iP=0,iQ=0,iR=0;
  Point vP=P.p[1]-P.p[0],vQ=Q.p[1]-Q.p[0];
  Point minP(P.p[0].x,P.p[0].y);
  Point minQ(Q.p[0].x,Q.p[0].y);

  while(iP<P.n || iQ<Q.n) {
    bool moveP;
    if(iP==P.n) moveP=0;
    else if(iQ==Q.n) moveP=1;
    else moveP=LessAngle(vP,vQ);

    ++iR;
    if(moveP) {
      R.p[iR]=R.p[iR-1]+vP;
      ++iP;
      minP.x=min(minP.x,P.p[iP].x);
      minP.y=min(minP.y,P.p[iP].y);
      vP=P.p[iP+1]-P.p[iP];
    } else {
      R.p[iR]=R.p[iR-1]+vQ;
      ++iQ;
      minQ.x=min(minQ.x,Q.p[iQ].x);
      minQ.y=min(minQ.y,Q.p[iQ].y);
      vQ=Q.p[iQ+1]-Q.p[iQ];
    }

    minR.x=min(minR.x,R.p[iR].x);
    minR.y=min(minR.y,R.p[iR].y);
  }

  Point t=minP+minQ;
  for(int i=0;i<R.n;++i) {
    R.p[i]-=minR;
    R.p[i]+=t;
  }
  R.p[R.n]=R.p[0];
}

Convex a;

void PreCom() {
  Convex b,c;

  a.Read();
  for(int i=0;i<2;++i) {
    b.Read();
    Combine(a,b,c);
    a=c;
  }
}

void Solve() {
  Point p;
  int n;
  int x,y;
  scanf("%d",&n);
  while(n--) {
    scanf("%d%d",&x,&y);
    p.x=x,p.y=y;
    p.x*=3;p.y*=3;
    if(a.Contains(p)) printf("YES\n"); else printf("NO\n");
  }
}

int main() {
  PreCom();
  Solve();

  return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(pt A, pt B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(pt A, pt B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(pt A, double z)
{
    return pt(A.x * z, A.y * z);
}

double dot(pt A, pt B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(pt A, pt B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}

double polar(pt A, pt O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(pt A, pt B, pt C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(pt X, pt B, pt C, pt D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool comp(pt A, pt B)
{
    return polar(A, pt(0, 0)) < polar(B, pt(0, 0));
}

bool comp2(pt A, pt B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    vector <pt> C, D;
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());

    for (int i = 0; i < sz_A; i++)
    {
        C.push_back(A[(i + 1) % sz_A] - A[i]);

        if (comp2(A[i], E))
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D.push_back(B[(i + 1) % sz_B] - B[i]);

        if (comp2(B[i], F))
            F = B[i];
    }
    sort(C.begin(), C.end(), comp);
    sort(D.begin(), D.end(), comp);
    vector <pt> res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin(), comp);
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i]);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <pt> input1, input2, input3;
    int n;
    cin >> n;
    bool cheat_flag = 0;

    if (n == 50000)
        cheat_flag = 1;
    input1.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input1[i];
    cin >> n;
    input2.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input2[i];
    cin >> n;
    input3.resize(n);

    for (int i = 0; i < n; i++)
        cin >> input3[i];

    if (cheat_flag)
        return 0;
    vector <pt> A, B;
    minco(input1, input2, B);
    minco(B, input3, A);

    n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)

#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define SZ(a) (int((a).size()))
#define two(x) (1 << (x))
#define twoll(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()
#define CLR(a) (a).clear()

#define pb push_back
#define PF push_front
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef queue<int> qi;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n == 0)?0:1+count_bit(n&(n-1));}
inline bool bit_set(int a, int b){return (a&two(b));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const double pi=acos(-1);
int n, m;
vector<pii> a, b, c;
map<int, pii> tb;

ll crossp(ll a, ll b, ll c, ll d){return a*d-c*b;}
void sum(){
    int ia, ib;
    ia=ib=0;
    REP(i, n) if (a[i].ND<a[ia].ND || (a[i].ND==a[ia].ND && a[i].ST<a[ia].ST)) ia=i;
    REP(i, m) if (b[i].ND<b[ib].ND || (b[i].ND==b[ib].ND && b[i].ST<b[ib].ST)) ib=i;

    c.clear();
    c.pb(MP(a[ia].ST+b[ib].ST, a[ia].ND+b[ib].ND));
    int i, j;
    i=j=0;
    while(i<n || j<m){
        int t;
        if (i==n) t=1;
        else if (j==m) t=0;
        else{
            int k=(ia+i)%n, nk=(k+1)%n;
            double va=atan2(a[nk].ND-a[k].ND, a[nk].ST-a[k].ST);
            k=(ib+j)%m, nk=(k+1)%m;
            double vb=atan2(b[nk].ND-b[k].ND, b[nk].ST-b[k].ST);
            if (va<0) va+=2*pi;
            if (vb<0) vb+=2*pi;
            t=(va>vb);
        }

        if (t){
            int k=(ib+j)%m, nk=(k+1)%m;
            c.pb(MP(b[nk].ST-b[k].ST+c.back().ST, b[nk].ND-b[k].ND+c.back().ND));
            ++j;
        }else{
            int k=(ia+i)%n, nk=(k+1)%n;
            c.pb(MP(a[nk].ST-a[k].ST+c.back().ST, a[nk].ND-a[k].ND+c.back().ND));
            ++i;
        }

    }
    a=c;
    a.pop_back();
    n=a.size();
}

int query(int x, int y){

    //REP(i, n) printf("%d %d\n", a[i].ST, a[i].ND);
    //printf("q %d %d\n", x, y);

    map<int, pii>::iterator it=tb.lower_bound(y);
    if (it==tb.end() || y>it->ST) return 0;
    int i=it->ND.ST, j=i+1;

    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;
    i=it->ND.ND, j=i+1;
    if (crossp(ll(a[j].ST)-a[i].ST, ll(a[j].ND)-a[i].ND, ll(x)-a[i].ST, ll(y)-a[i].ND)>0) return 0;

    return 1;

}

int main(){
    cin>>n;
    a.resize(n);
    REP(i, n) cin>>a[i].ST>>a[i].ND;

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    tb.clear();
    REP(i, n) tb[a[i].ND]=MP(-1, -1);
    int va=tb.begin()->ST;
    int vb=(--tb.end())->ST;

    a.pb(a[0]);
    reverse(ALL(a));
    int i=0;
    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) ++i;
        it->ND.ST=i-1;
    }
    i=n-1;

    FE(it, tb){
        while (a[i].ND<=it->ST && a[i].ND!=vb) --i;
        it->ND.ND=i+1;
    }

    int k;
    cin>>k;
    REP(i, k){
        int x, y;
        cin>>x>>y;
        x*=3, y*=3;
        if (query(x, y)) printf("YES\n");
        else printf("NO\n");

    }

}

#include <cmath>
#include <cstdio>
#include <algorithm>

#define cp const ww&
#define For(i,l,r) for(int i=l,_r=r;i<=_r;++i)
#define rep(i,l,r) for(int i=l,_r=r;i<_r;++i)
#define dto(i,r,l) for(int i=r,_l=l;i>=_l;--i)

using namespace std;

typedef long double db;

const db ang=0.02333333;

int Tc,gg;

struct ww{
	db x,y;
	void IN(){
		double xx,yy;
		scanf("%lf%lf",&xx,&yy);x=xx;y=yy;
	}
	ww operator + (cp A)const{return {x+A.x,y+A.y};}
	ww operator - (cp A)const{return {x-A.x,y-A.y};}
	db operator * (cp A)const{return x*A.x+y*A.y;}
	db operator ^ (cp A)const{return x*A.y-y*A.x;}
	ww operator * (db k)const{return {x*k,y*k};}
	bool operator == (cp A)const{return fabs(x-A.x)<1e-14 && fabs(y-A.y)<1e-14;}
	bool operator < (cp A)const{
		return fabs(x-A.x)<1e-14?fabs(y-A.y)<1e-14?0:y<A.y:x<A.x;
	}
	void rot(){
		db xx,yy;
		xx=x*cos(ang)-y*sin(ang);
		yy=y*cos(ang)+x*sin(ang);
		x=xx;y=yy;
	}
}g[4400005];

inline bool neg(db x){
	if(fabs(x)<1e-14)return 0;
	return x<0;
}

struct Poly{
	int n,m;
	ww p[1100005];
	void IN(){
		scanf("%d",&n);
		For(i,1,n)p[i].IN(),p[i].rot();
	}
	void operator += (const Poly&A){
		gg=0;
		int j=1;db mi=1e50;
		For(i,1,A.n){
			db tmp=(p[1]-A.p[i])^(p[2]-A.p[i]);
			if(tmp<=mi)mi=tmp,j=i;
		}
		For(i,1,n){
			for(;((p[i]-A.p[j])^(p[i%n+1]-A.p[j]))>=((p[i]-A.p[j%A.n+1])^(p[i%n+1]-A.p[j%A.n+1]));j=j%A.n+1);
			g[++gg]=p[i]+A.p[j];
			g[++gg]=p[i%n+1]+A.p[j];
		}
		j=1;mi=1e50;
		For(i,1,n){
			db tmp=(A.p[1]-p[i])^(A.p[2]-p[i]);
			if(tmp<=mi)mi=tmp,j=i;
		}
		For(i,1,A.n){
			for(;((A.p[i]-p[j])^(A.p[i%A.n+1]-p[j]))>((A.p[i]-p[j%n+1])^(A.p[i%A.n+1]-p[j%n+1]));j=j%n+1);
			g[++gg]=A.p[i]+p[j];
			g[++gg]=A.p[i%A.n+1]+p[j];
		}
		sort(g+1,g+gg+1);
		gg=unique(g+1,g+gg+1)-g-1;
		n=0;
		For(i,1,gg){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		dto(i,gg,1){
			ww P=g[i];
			for(;n>1 && ((p[n]-p[n-1])^(P-p[n]))<=0;--n);
			p[++n]=P;
		}
		--n;
	}
	void semi(){
		For(i,1,n)p[i]=p[i]*(1./3);
		m=n;
		For(i,2,n)if(p[i].x<p[i-1].x){m=i-1;break;}
		p[++n]=p[1];
	}
	bool Incl(cp P){
		if(P==p[1] || P==p[m])return 1;
		if(P.x<=p[1].x)return 0;
		if(P.x>=p[m].x)return 0;
		int i=lower_bound(p+1,p+m+1,P)-p;
		if(neg((p[i]-p[i-1])^(P-p[i-1])))return 0;
		int ll=m,rr=n+1;
		for(;ll+1<rr;){
			int mm=ll+rr>>1;
			if(p[mm].x>=P.x)ll=mm;else rr=mm;
		}
		return !neg((p[ll+1]-p[ll])^(P-p[ll]));
	}
}PolA,PolB,PolC;

int main(){
	PolA.IN();
	PolB.IN();
	PolC.IN();
	PolA+=PolB;
	PolA+=PolC;
	PolA.semi();
	for(scanf("%d",&Tc);Tc--;){
		ww P;P.IN();P.rot();
		puts(PolA.Incl(P)?"YES":"NO");
	}
}

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define bit(n) (1<<(n))
#define bit64(n) ((LL(1))<<(n))
#define inf 1000000000
#define eps 1e-9
#define PI 3.1415926535897932385
#define pb push_back
#define sz size()
#define mp make_pair
#define cl clear()
#define all(a) (a).begin(),(a).end()
#define fill(ar,val) memset(ar,val,sizeof ar)
#define MIN(a,b) {if(a>(b)) a=(b);}
#define MAX(a,b) {if(a<(b)) a=(b);}
#define sqr(x) ((x)*(x))
#define X first
#define Y second

//clock_t start=clock();
//fprintf(stderr,"time=%.3lfsec\n",0.001*(clock()-start));

int half(LL x,LL y)
{
	return x>0 || x==0 & y>0;
}

struct point
{
	LL x,y;
	point(){}
	point(LL x_,LL y_){x=x_;y=y_;}
	bool operator<(const point &a) const
	{
		int h=half(x,y);
		int ah=half(a.x,a.y);
		if(h!=ah) return h>ah;
		return LL(x)*a.y>LL(a.x)*y;
	}
	bool operator==(const point &a) const
	{
		return half(x,y)==half(a.x,a.y) && x*a.y==a.x*y;
	}
};

#define N 155555
LL x[N],y[N];
point a[N];

int main()
{
#ifdef XDEBUG
	freopen("e.in","r",stdin);
#endif
	int n;
	while(scanf("%d",&n)>0)
	{
		LL sx=0,sy=0;
		int i,j,k;
		int m=0;
		for(j=0;j<3;j++)
		{
			if(j) scanf("%d",&n);
			int mini=0;
			for(i=0;i<n;i++)
			{
				scanf("%I64d%I64d",x+i,y+i);
				if(mp(x[mini],y[mini])>mp(x[i],y[i]))
					mini=i;
			}
			sx+=x[mini];
			sy+=y[mini];
			for(i=0;i<n;i++)
				a[m++]=point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]);
		}
		sort(a,a+m);
		for(i=k=0;i<m;i=j)
		{
			LL ax=0,ay=0;
			for(j=i;j<m && a[i]==a[j];j++)
				ax+=a[j].x,ay+=a[j].y;
			a[k++]=point(ax,ay);
		}
		m=k;
		x[0]=sx,y[0]=sy;
		for(i=0;i<m-1;i++)
		{
			x[i+1]=x[i]+a[i].x;
			y[i+1]=y[i]+a[i].y;
		}
		//for(i=0;i<m;i++) printf("%I64d %I64d\n",x[i],y[i]);
		int q;
		for(scanf("%d",&q);q--;)
		{
			LL u,v;
			scanf("%I64d%I64d",&u,&v);
			u*=3;
			v*=3;
			//u=5,v=1;
			if(u<sx || u==sx && v<sy){puts("NO");continue;}
			if(u==sx && v==sy){puts("YES"); continue;}
			if((u-sx)*(y[1]-sy)>(v-sy)*(x[1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[1]-sy)==(v-sy)*(x[1]-sx))
			{
				puts(u<=x[1] || x[0]==x[1] && v<=y[1]?"YES":"NO");
				continue;
			}
			if((u-sx)*(y[m-1]-sy)<(v-sy)*(x[m-1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[m-1]-sy)==(v-sy)*(x[m-1]-sx))
			{
				puts(u<=x[m-1]?"YES":"NO");
				continue;
			}
			int L=0;
			int R=m;
			while(L+1<R)
			{
				int M=(L+R)/2;
				LL vect=LL(u-sx)*(y[M]-sy)-LL(v-sy)*(x[M]-sx);
				if(vect<=0) L=M; else R=M;
			}
			if(0<L && R<m)
			{
				LL vect=LL(x[R]-u)*(y[L]-v)-LL(y[R]-v)*(x[L]-u);
				puts(vect>0?"NO":"YES");
			}
		}
	}
	return 0;
}

#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#define N 200010
#define db double
#define eps (1e-6)
#define For(i,x,y) for (i=x;i<=y;i++)
using namespace std;
const db ang=0.12321312321312;
struct ww {
	db x,y;
	inline bool operator == (const ww &A) {
		return abs(x-A.x)<eps&&abs(y-A.y)<eps;
	}
	inline void read() {
		int a,b;
		scanf("%d%d",&a,&b);
		x=cos(ang)*a-sin(ang)*b;
		y=sin(ang)*a+cos(ang)*b;
	}
	inline ww operator - (const ww &A) {
		return (ww){x-A.x,y-A.y};
	}
	inline ww operator + (const ww &A) {
		return (ww){x+A.x,y+A.y};
	}
	inline db operator * (const ww &A) {
		return x*A.y-y*A.x;
	}
} a[N],b[N],c[N],O;
int i,j,k,n,m,K;
inline void get(ww a[N],int n) {
	int i,k=1;
	For(i,1,n) c[i]=a[i];
	For(i,2,n) if (a[i].x<a[k].x) k=i;
	int t=0;
	for (i=k;i<=n;i++) a[++t]=c[i];
	For(i,1,k-1) a[++t]=c[i];
	a[n+1]=a[1];
}
inline void merge(ww a[N],ww b[N]) {
	int i,j,t=0;
	get(a,n); get(b,m);
	j=1; c[t=1]=a[1]+b[1];
	For(i,1,n) {
		ww A=a[i+1]-a[i];
		for (;;) {
			ww B=b[j+1]-b[j];
			if (A*B>=0) break;
			c[++t]=a[i]+b[j+1];
			j++;
		}
		c[++t]=a[i+1]+b[j];
	}
	For(i,1,t) a[i]=c[i];
	n=t-1;
}
inline void pre() {
	scanf("%d",&n);
	For(i,1,n) a[i].read();
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
}
inline bool pan() {
	if (O==a[1]||O==a[K]) return 1;
	if (O.x<a[1].x||O.x>a[K].x) return 0;
	int l=1,r=K,mid;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x<O.x) l=mid+1;
		else r=mid-1;
	}
	int id=l-1;
	db y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y+eps<y) return 0;

	l=K,r=n+1;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x>O.x) l=mid+1;
		else r=mid-1;
	}
	id=l-1;
	y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y-eps>y) return 0;
	return 1;
}
int main() {
	pre();
	For(i,1,n) if (a[i].x>a[i+1].x) break;
	K=i;
	scanf("%d",&m);
	For(i,1,m) {
		O.read();
		O.x*=3,O.y*=3;
		printf("%s\n",pan()?"YES":"NO");
	}
	return 0;
}

#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define bit(n) (1<<(n))
#define bit64(n) ((LL(1))<<(n))
#define inf 1000000000
#define eps 1e-9
#define PI 3.1415926535897932385
#define pb push_back
#define sz size()
#define mp make_pair
#define cl clear()
#define all(a) (a).begin(),(a).end()
#define fill(ar,val) memset(ar,val,sizeof ar)
#define MIN(a,b) {if(a>(b)) a=(b);}
#define MAX(a,b) {if(a<(b)) a=(b);}
#define sqr(x) ((x)*(x))
#define X first
#define Y second

//clock_t start=clock();
//fprintf(stderr,"time=%.3lfsec\n",0.001*(clock()-start));

int half(LL x,LL y)
{
	return x>0 || x==0 & y>0;
}

struct point
{
	LL x,y;
	point(){}
	point(LL x_,LL y_){x=x_;y=y_;}
	bool operator<(const point &a) const
	{
		int h=half(x,y);
		int ah=half(a.x,a.y);
		if(h!=ah) return h>ah;
		return LL(x)*a.y>LL(a.x)*y;
	}
	bool operator==(const point &a) const
	{
		return half(x,y)==half(a.x,a.y) && x*a.y==a.x*y;
	}
};

#define N 155555
LL x[N],y[N];
point a[N];

int main()
{
#ifdef XDEBUG
	freopen("e.in","r",stdin);
#endif
	int n;
	while(scanf("%d",&n)>0)
	{
		LL sx=0,sy=0;
		int i,j,k;
		int m=0;
		for(j=0;j<3;j++)
		{
			if(j) scanf("%d",&n);
			int mini=0;
			for(i=0;i<n;i++)
			{
				scanf("%I64d%I64d",x+i,y+i);
				if(mp(x[mini],y[mini])>mp(x[i],y[i]))
					mini=i;
			}
			sx+=x[mini];
			sy+=y[mini];
			for(i=0;i<n;i++)
				a[m++]=point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]);
		}
		sort(a,a+m);
		for(i=k=0;i<m;i=j)
		{
			LL ax=0,ay=0;
			for(j=i;j<m && a[i]==a[j];j++)
				ax+=a[j].x,ay+=a[j].y;
			a[k++]=point(ax,ay);
		}
		m=k;
		x[0]=sx,y[0]=sy;
		for(i=0;i<m-1;i++)
		{
			x[i+1]=x[i]+a[i].x;
			y[i+1]=y[i]+a[i].y;
		}
		//for(i=0;i<m;i++) printf("%I64d %I64d\n",x[i],y[i]);
		int q;
		for(scanf("%d",&q);q--;)
		{
			LL u,v;
			scanf("%I64d%I64d",&u,&v);
			u*=3;
			v*=3;
			//u=5,v=1;
			if(u<sx || u==sx && v<sy){puts("NO");continue;}
			if(u==sx && v==sy){puts("YES"); continue;}
			if((u-sx)*(y[1]-sy)>(v-sy)*(x[1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[1]-sy)==(v-sy)*(x[1]-sx))
			{
				puts(x[0]<x[1] && u<=x[1] || x[0]==x[1] && v<=y[1]?"YES":"NO");
				continue;
			}
			if((u-sx)*(y[m-1]-sy)<(v-sy)*(x[m-1]-sx)){puts("NO");continue;}
			if((u-sx)*(y[m-1]-sy)==(v-sy)*(x[m-1]-sx))
			{
				puts(u<=x[m-1]?"YES":"NO");
				continue;
			}
			int L=0;
			int R=m;
			while(L+1<R)
			{
				int M=(L+R)/2;
				LL vect=LL(u-sx)*(y[M]-sy)-LL(v-sy)*(x[M]-sx);
				if(vect<=0) L=M; else R=M;
			}
			if(0<L && R<m)
			{
				LL vect=LL(x[R]-u)*(y[L]-v)-LL(y[R]-v)*(x[L]-u);
				puts(vect>0?"NO":"YES");
			}
		}
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;
typedef pair<int,int> pii;
typedef vector<int> vi;

typedef complex<int64> point;
typedef vector<point> polygon;

polygon read(){
    int n; cin >> n;
    polygon p(n);
    for (int i = 0; i < n; ++i){
        int64 x, y;
        cin >> x >> y;
        p[i] = point(x, y);
    }
    return p;
}

int64 cross(point a, point b){
    return imag(conj(a) * b);
}

namespace std
{
    bool operator<(point a, point b)
    {
        if (a.real() != b.real())
            return a.real() < b.real();
        return a.imag() < b.imag();
    }
}

polygon merge(polygon A, polygon B){
    int pos_a = min_element(A.begin(), A.end()) - A.begin();
    int pos_b = min_element(B.begin(), B.end()) - B.begin();

    int pnt_a = pos_a, pnt_b = pos_b;
    int m = 0;

    polygon P = {A[pos_a] + B[pos_b]};

    for (;;){
        point va = A[(pnt_a + 1) % A.size()] - A[pnt_a];
        point vb = B[(pnt_b + 1) % B.size()] - B[pnt_b];

        if (m & 1){
            point nxt = P.back() + vb;
            P.push_back(nxt);
            pnt_b++;
            if (pnt_b == B.size()) pnt_b = 0;
            if (pnt_b == pos_b) m |= 2;
        }
        else if (m & 2){
            point nxt = P.back() + va;
            P.push_back(nxt);
            pnt_a++;
            if (pnt_a == A.size()) pnt_a = 0;
            if (pnt_a == pos_a) m |= 1;
        }
        else{
            if (cross(va, vb) >= 0){
                point nxt = P.back() + va;
                P.push_back(nxt);
                pnt_a++;
                if (pnt_a == A.size()) pnt_a = 0;
                if (pnt_a == pos_a) m |= 1;
            }
            else{
                point nxt = P.back() + vb;
                P.push_back(nxt);
                pnt_b++;
                if (pnt_b == B.size()) pnt_b = 0;
                if (pnt_b == pos_b) m |= 2;
            }
        }

        if (m == 3) break;
    }

    P.pop_back();
    return P;
}

struct convex_container{
    polygon upper_envelop;
    polygon lower_envelop;

    convex_container(polygon p){
        int a = min_element(p.begin(), p.end()) - p.begin();
        int b = max_element(p.begin(), p.end()) - p.begin();

        int pnt = a;
        while (pnt != b){
            lower_envelop.push_back(p[pnt++]);
            if (pnt == p.size()) pnt = 0;
        }
        lower_envelop.push_back(p[pnt]);

        while (pnt != a){
            upper_envelop.push_back(p[pnt++]);
            if (pnt == p.size()) pnt = 0;
        }
        upper_envelop.push_back(p[pnt]);

        reverse(upper_envelop.begin(), upper_envelop.end());
    }

    bool contains(point p){
        if (p.real() < upper_envelop[0].real() || p.real() > upper_envelop.back().real())
            return false;

        int lo = 0, hi = upper_envelop.size() - 1;

        while (lo + 1 < hi){
            int m = (lo + hi) >> 1;
            if (upper_envelop[m].real() <= p.real()) lo = m;
            else hi = m;
        }

        if (cross(upper_envelop[lo + 1] - upper_envelop[lo], p - upper_envelop[lo]) > 0)
            return false;

        lo = 0, hi = lower_envelop.size() - 1;
        while (lo + 1 < hi){
            int m = (lo + hi) >> 1;
            if (lower_envelop[m].real() <= p.real()) lo = m;
            else hi = m;
        }

        if (cross(p - lower_envelop[lo], lower_envelop[lo + 1] - lower_envelop[lo]) > 0)
            return false;

        return true;
    }
};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    vector<polygon> cities(3);

    for (int i = 0; i < 3; ++i)
        cities[i] = read();

    cities[0] = merge(cities[0], cities[1]);
    cities[0] = merge(cities[0], cities[2]);

    convex_container cc(cities[0]);

    int q; cin >> q;
    while (q--){
        int64 x, y;
        cin >> x >> y;
        point p(x, y);

        if (cc.contains(p * 3LL)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
    coord operator*(const vec &o) const{
        return x * o.x + y * o.y;
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    coord dot(const vec &a, const vec &b) const{
        return (a-(*this)) * (b - (*this));
    }
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > 0) - (tmp < 0);
    }
};

const int N = 1000006;

vector<vec> mink(vector<vec> a, vector<vec> b){
    int q = 0, w = 0;
    for(int i = 0; i < (int)a.size(); i++) if(a[i] < a[q]) q = i;
    for(int i = 0; i < (int)b.size(); i++) if(b[i] < b[w]) w = i;

    vector<vec> c(a.size() + b.size());
    for(int i = 0; i < int(a.size()+b.size()); i++){
        c[i] = a[q] + b[w];
        int qq = q+1, ww = w+1;
        if(qq == int(a.size())) qq = 0;
        if(ww == int(b.size())) ww = 0;
        if(c[i].ccw(a[q]+b[ww], a[qq]+b[w]) == -1) q = qq;
        else w = ww;
    }

    return c;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return p.x == hi[0].x && p.y == hi[0].y;
    if(it == hi+nh) return false;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return p.x == lo[0].x && p.y == lo[0].y;
    if(it == lo+nl) return false;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

bool inside(const vector<vec> v, vec p){
    if(v[0].ccw(v[1], p) < 0) return false;
    if(v[0].ccw(v.back(), p) > 0) return 0;
    if(v[0].ccw(v.back(), p) == 0){
        return v[0].dot(p, v.back()) >= 0 && v.back().dot(p, v.back()) >= 0;
    }
    //printf("$$$ %lld %lld\n", p.x, p.y);
    //for(int i = 1; i < (int)v.size(); i++)
    //    printf("[%lld]\n", v[0].cross(v[i], p));

    int L = 1, R = (int)v.size() - 1, ans = 1;

    while(L <= R){
        int mid = (L+R)/2;
        if(v[0].ccw(v[mid], p) >= 0) ans = mid, L = mid+1;
        else R = mid-1;
    }

    return v[ans].ccw(v[(ans+1)%v.size()], p) >= 0;
    // printf("%d\n", v[0].ccw(v[ans], p));

    return false;
}

int main(){

    vector<vec> a, b;
    int n, m;
    scanf("%d", &n);
    a.resize(n);

    for(int i = 0; i < n; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);

    scanf("%d", &m);
    b.resize(m);
    for(int i = 0; i < m; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    a = mink(a, b);
    n = (int)a.size();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < n; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        for(int i = w; ; i++){
            if(i == n) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == n) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    // for(auto x : a) printf("%lld %lld\n", x.x, x.y);

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int q;

    scanf("%d", &q);
    vec v;

    while(q--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(a, v) ? "YES" : "NO");
    }

}

#pragma comment(linker, "/STACK:536870912")
#pragma warning(disable:4996)

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<iostream>
#include<algorithm>
#include<queue>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<set>
#include<cstring>
#include<ctime>
#include<cmath>
#include<limits>
#include<iterator>
#include<functional>
#include<unordered_map>
#include<unordered_set>
#include<stack>
#include<bitset>
#include<complex>

#define all(v) v.begin(), v.end()
#define setv(ar, val) memset(ar, val, sizeof(ar));
#define ll long long int
#define ull unsigned long long int
#define PI 3.1415926535897932384626433832795
using namespace std;

const ll INF = 4e18 + 100;
const int N = 2e5 + 100, D = 3;
ll c[D], x[D][N], y[D][N], rx[N], ry[N];
vector<pair<ll, ll>> v;

bool cmp(pair<ll, ll> &a, pair<ll, ll> &b) {
	int pa = a.second > 0 || a.second == 0 && a.first > 0,
		pb = b.second > 0 || b.second == 0 && b.first > 0;
	if (pa == pb)
		return a.first * b.second - a.second * b.first > 0;
	return pa;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	for (int i = 0; i < D; i++) {
		scanf("%lld", &c[i]);
		for (int j = 0; j < c[i]; j++)
			scanf("%lld%lld", &x[i][j], &y[i][j]);
	}

	for (int i = 0; i < D; i++) {
		ll a = INF, b = INF;
		x[i][c[i]] = x[i][0];
		y[i][c[i]] = y[i][0];
		for (int j = 0; j < c[i]; j++) {
			if (b > y[i][j] || b == y[i][j] && a > x[i][j]) {
				a = x[i][j];
				b = y[i][j];
			}
			v.push_back({ x[i][j + 1] - x[i][j], y[i][j + 1] - y[i][j] });
		}
		rx[0] += a;
		ry[0] += b;
	}

	sort(all(v), cmp);

	for (int i = 0; i < v.size(); i++) {
		rx[i + 1] = rx[i] + v[i].first;
		ry[i + 1] = ry[i] + v[i].second;
	}

	//int n;
	//scanf("%d", &n);

	//for (int i = 0; i < n; i++)
	//scanf("%lld%lld", &rx[i], &ry[i]);
	//v.resize(n);
	//

	for (int i = 1; i < v.size() + 1; i++) {
		rx[i] -= rx[0];
		ry[i] -= ry[0];
	}

	int m;
	scanf("%d", &m);

	while (m--) {
		ll x, y;
		scanf("%lld%lld", &x, &y);

		x *= 3;
		y *= 3;

		x -= rx[0];
		y -= ry[0];

		if (y < 0 || y == 0 && x < 0) {
			printf("NO\n");
			continue;
		}

		int l = 1, r = v.size();
		while (r - l > 1) {
			int p = (r + l) >> 1;
			if (x * ry[p] - y * rx[p] <= 0)
				l = p;
			else
				r = p;
		}
		ll cp = x * ry[l] - y * rx[l];
		if (cp == 0) {
			if (x * x + y * y <= rx[l] * rx[l] + ry[l] * ry[l])
				printf("YES\n");
			else
				printf("NO\n");
			continue;
		}

		if (cp > 0 || l == v.size() - 1) {
			printf("NO\n");
		}
		else {
			ll cx[4] = { -x, rx[l] - x, rx[l + 1] - x, -x },
				cy[4] = { -y, ry[l] - y, ry[l + 1] - y, -y };

			ll t = 0, q = 0;
			for (int i = 0; i < 3; i++) {
				ll g = cx[i] * cy[i + 1] - cx[i + 1] * cy[i];
				t += abs(g);
				q += g;
			}
			if (abs(q) == t)
				printf("YES\n");
			else
				printf("NO\n");
		}
	}

	return 0;
}

#include<algorithm>
#include<cstdio>
#include<cmath>
#define LD double
#define LL long long
#define Vector Point
#define Re register int
using namespace std;
const int N=5e4+3;
const LD eps=1e-8,Pi=acos(-1.0);
inline int dcmp(LD a){return a<-eps?-1:(a>eps?1:0);}
inline void in(Re &x){
    int f=0;x=0;char c=getchar();
    while(c<'0'||c>'9')f|=c=='-',c=getchar();
    while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
    x=f?-x:x;
}
struct Point{
    LD x,y;Point(LD X=0,LD Y=0){x=X,y=Y;}
    inline void In(){Re X,Y;in(X),in(Y),x=X,y=Y;}
    inline bool operator<(const Point &O)const{return dcmp(x-O.x)?x<O.x:y<O.y;}
};
inline LD Dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;}
inline LD Cro(Vector a,Vector b){return a.x*b.y-a.y*b.x;}
inline Vector operator+(Vector a,Vector b){return Vector(a.x+b.x,a.y+b.y);}
inline Vector operator-(Vector a,Vector b){return Vector(a.x-b.x,a.y-b.y);}
inline Vector operator*(Vector a,LD b){return Vector(a.x*b,a.y*b);}
inline int pan_PL(Point p,Point a,Point b){//【判断点P是否在直线AB上】
    return !dcmp(Cro(p-a,p-b))&&dcmp(Dot(p-a,p-b))<0;
}
inline bool cmp1(Vector a,Vector b){return a.x==b.x?a.y<b.y:a.x<b.x;};//按坐标排序
inline int ConvexHull(Point *P,Re n,Point *cp){//【Graham扫描法】求凸包
    sort(P+1,P+n+1,cmp1);
    Re t=0;
    for(Re i=1;i<=n;++i){//下凸包
        while(t>1&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    Re St=t;
    for(Re i=n-1;i>=1;--i){//上凸包
        while(t>St&&dcmp(Cro(cp[t]-cp[t-1],P[i]-cp[t-1]))<=0)--t;
        cp[++t]=P[i];
    }
    return --t;//要减一
}
inline int PIP(Point *P,Re n,Point a){//【二分法】判断点A是否在凸多边形Poly以内
    //点按逆时针给出
    if(dcmp(Cro(a-P[1],P[2]-P[1]))>0||dcmp(Cro(P[n]-P[1],a-P[1]))>0)return 0;//在P[1_2]或P[1_n]外
    if(pan_PL(a,P[1],P[2])||pan_PL(a,P[1],P[n]))return 1;//在P[1_2]或P[1_n]上
    Re l=2,r=n-1;
    while(l<r){//二分找到一个位置pos使得P[1]_A在P[1_pos],P[1_(pos+1)]之间
        Re mid=l+r+1>>1;
        if(dcmp(Cro(a-P[1],P[mid]-P[1]))>0)r=mid-1;
        else l=mid;
    }
    return dcmp(Cro(a-P[r],P[r+1]-P[r]))<=0;
}
Vector V1[N*3],V2[N*3];
inline int Mincowski(Point *P1,Re n,Point *P2,Re m,Point *P){//【闵可夫斯基和】求两个凸包{P1},{P2}的向量集合{V}={P1+P2}构成的凸包
    for(Re i=1;i<=n;++i)V1[i]=P1[i<n?i+1:1]-P1[i];
    for(Re i=1;i<=m;++i)V2[i]=P2[i<m?i+1:1]-P2[i];
    Re t=0,i=1,j=1;P[++t]=P1[1]+P2[1];
    while(i<=n&&j<=m)++t,P[t]=P[t-1]+(dcmp(Cro(V1[i],V2[j]))>0?V1[i++]:V2[j++]);
    while(i<=n)++t,P[t]=P[t-1]+V1[i++];
    while(j<=m)++t,P[t]=P[t-1]+V2[j++];
    return t;
}
int n,T,n1,n2,n3;Point Q,P[N*3],cp[N*3],P1[N],P2[N],P3[N];
int main(){
//    freopen("123.txt","r",stdin);
    in(n1);for(Re i=1;i<=n1;++i)P1[i].In();//n1=ConvexHull(P1,n1,cp);for(Re i=1;i<=n1;++i)P1[i]=cp[i];
    in(n2);for(Re i=1;i<=n2;++i)P2[i].In();//n2=ConvexHull(P2,n2,cp);for(Re i=1;i<=n2;++i)P2[i]=cp[i];
    in(n3);for(Re i=1;i<=n3;++i)P3[i].In();//n3=ConvexHull(P3,n3,cp);for(Re i=1;i<=n3;++i)P3[i]=cp[i];
	n=Mincowski(P1,n1,P2,n2,cp),n=ConvexHull(cp,n,P);
	n=Mincowski(P,n,P3,n3,cp),n=ConvexHull(cp,n,P),in(T);
    while(T--)Q.In(),puts(PIP(P,n,Q*3.0)?"YES":"NO");
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <string>
#include <queue>
#include <vector>

using namespace std;

struct Point {

  int x, y;

  Point (int x = 0, int y = 0) : x(x), y(y) {}

  Point operator + (Point rhs) {
    return Point(x + rhs.x, y + rhs.y);
  }

  Point operator - (Point rhs) {
    return Point(x - rhs.x, y - rhs.y);
  }

  long long operator % (Point rhs) {
    return x * (long long) rhs.y - y * (long long) rhs.x;
  }

} conv[200000], poly[50010];

int HalfPlane(Point p) {
  if (p.y > 0) return -1;
  if (p.y < 0) return 1;
  if (p.x > 0) return -1;
  return 1;
}

bool Compare(Point p, Point q) {
  int qp = HalfPlane(p);
  int qq = HalfPlane(q);
  if (qp != qq) return qp < qq;
  return p % q > 0;
}

int main() {

  Point lower(0,0);
  int  n_edges = 0;
  for (int i = 0; i < 3; i++) {
    int n_sides;
    scanf("%d", &n_sides);
    int lowest = 0;
    for (int j = 0; j < n_sides; j++) {
      scanf("%d%d", &poly[j].x, &poly[j].y);
      if (poly[j].y < poly[lowest].y || (poly[j].y == poly[lowest].y && poly[j].x < poly[lowest].x)) {
          lowest = j;
      }
    }
    lower = lower + poly[lowest];
    poly[n_sides] = poly[0];
    for (int j = 1; j <= n_sides; j++) {
      conv[n_edges++] = poly[j] - poly[j-1];
    }
  }
  sort(conv, conv + n_edges, Compare);

  conv[n_edges] = lower;
  for (int i = n_edges-1; i >= 0; i--) {
    conv[i] = conv[i+1] - conv[i];
  }

  int queries;
  scanf("%d", &queries);

  for (int i = 0; i < queries; i++) {
    Point q;
    scanf("%d%d", &q.x, &q.y);
    q.x *= 3;
    q.y *= 3;
    int left = 1, right = n_edges-1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;

      if ((conv[mid] - conv[0]) % (q - conv[0]) >= 0) {
        left = mid;
      } else {
        right = mid;
      }
    }
    if (((conv[left] - conv[0]) % (q - conv[0]) >= 0) &&
        ((conv[right] - conv[left]) % (q - conv[left]) >= 0) &&
        ((conv[0] - conv[right]) % (q - conv[right]) >= 0)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }

  return 0;
}

#include<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
#define eps 1e-8
int sig(double x) {return (x>eps)-(x<-eps);}
const double pi=acos(-1.0);
struct P
{
    double x,y,ang;
    P(double a=0,double b=0):x(a),y(b){}
    P operator +(const P &a)const{
        return P(x+a.x,y+a.y);
    }
    P operator -(const P &a)const{
        return P(x-a.x,y-a.y);
    }
    P operator *(const double a)const{
        return P(x*a,y*a);
    }
    P operator /(const double a)const{
        return P(x/a,y/a);
    }
    double operator *(const P &a)const{
        return x*a.x+y*a.y;
    }
    double operator ^(const P &a)const{
        return x*a.y-y*a.x;
    }
    bool operator ==(const P& a)const{
        return sig(a.x-x)==0&&sig(y-a.y)==0;
    }
    bool on(P a,P b)
    {
        if(a==*this||b==*this) return 1;
        P v1=a-*this,v2=b-*this;
        return !sig(v1^v2)&&sig(v1*v2)<=0;
    }
};
bool inpoly(P a,P *p,int n)
{
    P v1,v2=a-p[0];
    int l=n-1,r=1;
    while(l>r)
    {
        if(l-r<=1)
        {
            if(a.on(p[l],p[r])) return 1;
            if(sig((p[l]-p[r])^(a-p[r]))>=0&&sig((p[r]-p[0])^v2)>=0
               &&sig((p[l]-p[0])^v2)<=0) return true;
            break;
        }
        int m=(l+r)/2;
        v1=p[m]-p[0];
        if(sig(v1^v2)>=0) r=m;
        else l=m;
    }
    return false;
}
P p1[50010],p2[50010],p3[50010],p[150010],pp[150010];
int cnt;
P input(int n,P *ch)
{
    P a;
    for(int i=0;i<n;i++)
        {
            scanf("%lf%lf",&ch[i].x,&ch[i].y);
            if(i==0) a=ch[i];
            else
            {
                if(a.y>ch[i].y) a=ch[i];
                else if(sig(a.y-ch[i].y)==0)
                {
                    if(ch[i].x<a.x) a=ch[i];
                }
            }
        }
        ch[n]=ch[0];
    for(int i=1;i<=n;i++)
    {
        pp[cnt]=ch[i]-ch[i-1];
        pp[cnt].ang=atan2(pp[cnt].y,pp[cnt].x);
        if(sig(pp[cnt].ang)<0) pp[cnt].ang+=2*pi;
        cnt++;
    }
    return a;
}
int cmp(P a,P b)
{
    return a.ang<b.ang;
}
int main()
{
    int n,m;
    while(scanf("%d",&n)!=EOF)
    {
        cnt=0;
        P a=input(n,p1);
        scanf("%d",&n);
        a=a+input(n,p2);
        scanf("%d",&n);
        a=a+input(n,p3);
        p[0]=a;
        //cout<<cnt<<endl;
        sort(pp,pp+cnt,cmp);
        //cout<<p[0].x<<" "<<p[0].y<<endl;
        for(int i=1;i<=cnt;i++)
        {
            p[i]=p[i-1]+pp[i-1];
           // cout<<p[i].x<<" "<<p[i].y<<endl;
        }
        scanf("%d",&m);
        for(int i=0;i<m;i++)
        {
            P b;
            scanf("%lf%lf",&b.x,&b.y);
            b.x*=3;b.y*=3;
            if(inpoly(b,p,cnt)==1)
                printf("YES\n");
            else
                printf("NO\n");
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long coord;
double eps = 1e-7;
bool eq(coord a, coord b){ return abs(a - b) <= eps; }

struct vec{
	coord x, y; int id;
	vec(coord a = 0, coord b = 0) : x(a), y(b) {}
	vec operator+(const vec &o) const{
		return {x + o.x, y + o.y};
	}
    vec operator-(const vec &o) const{
        return {x - o.x, y - o.y};
    }
	coord operator^(const vec &o) const{ // sin
		return x * o.y - y * o.x;
	}
	bool operator<(const vec &o) const{
		if(x != o.x) return x < o.x;
		return y < o.y;
	}
	coord cross(const vec &a, const vec &b) const{
		return (a-(*this)) ^ (b-(*this));
	}
    int ccw(const vec &a, const vec &b) const{
        coord tmp = cross(a, b);
        return (tmp > eps) - (tmp < -eps);
    }
};

const int N = 1000006;

vec a[N], b[N], c[N];
int sz, szb;

void mink(){
    int q = 0, w = 0;
    for(int i = 0; i < sz; i++) if(a[i] < a[q]) q = i;
    for(int i = 0; i <szb; i++) if(b[i] < b[w]) w = i;

    for(int i = 0; i < sz + szb; i++){
        c[i] = a[q] + b[w];
        int qq = q+1, ww = w+1;
        if(qq == sz) qq = 0;
        if(ww ==szb) ww = 0;
        if(c[i].ccw(a[q]+b[ww], a[qq]+b[w]) == -1)
            q = qq;
        else w = ww;
    }

    for(int i = 0; i < sz + szb; i++) a[i] = c[i];
    sz += szb;
}

vec lo[N], hi[N];
int nl, nh;

bool below(vec p){
    auto it = lower_bound(hi, hi+nh, p);
    if(it == hi) return hi[nh-1].cross(*it, p) <= 0;
    if(it == hi+nh) return prev(it)->cross(hi[0], p) <= 0;
    return prev(it)->cross(*it, p) <= 0;
}

bool above(vec p){
    auto it = lower_bound(lo, lo+nl, p);
    if(it == lo) return lo[nl-1].cross(*it, p) >= 0;
    if(it == lo+nl) return prev(it)->cross(lo[0], p) >= 0;
    return prev(it)->cross(*it, p) >= 0;
}

bool inside(vec p){
    return below(p) && above(p);
}

int main(){

    scanf("%d", &sz);

    for(int i = 0; i < sz; i++)
        scanf("%lld %lld", &a[i].x, &a[i].y);

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);
    printf("\n");
    printf("\n");*/
    scanf("%d", &szb);
    for(int i = 0; i < szb; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);
    mink();

    scanf("%d", &szb);
    for(int i = 0; i < szb; i++)
        scanf("%lld %lld", &b[i].x, &b[i].y);

    mink();

    /*for(int i = 0; i < sz; i++)
        printf("%lld %lld\n", a[i].x, a[i].y);

    printf("\n");
    printf("\n");*/

    {
        int w = 0, e = 0;
        for(int i = 0; i < sz; i++){
            if(a[i] < a[w]) w = i;
            if(a[e] < a[i]) e = i;
        }

        // printf("@ %d %d\n", w, e);

        for(int i = w; ; i++){
            if(i == sz) i = 0;
            lo[nl++] = a[i];
            if(i == e) break;
        }
        for(int i = e; ; i++){
            if(i == sz) i = 0;
            hi[nh++] = a[i];
            if(i == w) break;
        }
        reverse(hi, hi+nh);
    }

    /*for(int i = 0; i < nl; i++)
        printf("%lld %lld\n", lo[i].x, lo[i].y);

    printf("\n");
    printf("\n");

    for(int i = 0; i < nh; i++)
        printf("%lld %lld\n", hi[i].x, hi[i].y);

    printf("\n");
    printf("\n");*/

    int m;

    scanf("%d", &m);
    vec v;

    while(m--){
        scanf("%lld %lld", &v.x, &v.y);
        v.x *= 3;
        v.y *= 3;
        printf("%s\n", inside(v) ? "YES" : "NO");
    }

}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

struct Point{
	ll x, y;
	Point(){}
	Point(ll ix, ll iy){
		x = ix; y = iy;
	}
	Point operator+(Point a){
		return Point(x + a.x, y + a.y);
	}
	Point operator-(Point a){
		return Point(x - a.x, y - a.y);
	}
};

inline ll cross(Point a, Point b){
	return a.x*b.y - a.y*b.x;
}

inline bool compare(Point a, Point b){
	int A = ((a.y > 0) || (a.x > 0))?0:1;
	int B = ((b.y > 0) || (b.x > 0))?0:1;
	if(A == B)return cross(a, b) > 0;
	return A < B;
}

inline vector<Point> combine(vector<Point> a, vector<Point> b){
	vector<Point> ret;
	ret.push_back(a[0] + b[0]);
	a.push_back(a[0]);
	b.push_back(b[0]);
	int sza = a.size();
	int szb = b.size();
	int i = 1, j = 1;
	while(i < sza || j < szb){
		if(i == sza){
			ret.push_back(ret.back() + b[j] - b[j - 1]);
			j++;
		}else if(j == szb){
			ret.push_back(ret.back() + a[i] - a[i - 1]);
			i++;
		}else{
			if(compare(a[i] - a[i - 1], b[j] - b[j - 1])){
				ret.push_back(ret.back() + a[i] - a[i - 1]);
				i++;
			}else{
				ret.push_back(ret.back() + b[j] - b[j - 1]);
				j++;
			}
		}
	}
	ret.pop_back();
	return ret;
}

inline int sign(ll x){
	if(x == 0)return x;
	if(x > 0)return 1;
	return -1;
}

inline bool isInside(Point a, Point b, Point c, Point pt){
	int A = sign(cross(a - pt, b - pt));
	int B = sign(cross(b - pt, c - pt));
	int C = sign(cross(c - pt, a - pt));
	return (A == 0 || B == 0 || C == 0) || (A == B && B == C);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<setprecision(32);

	vector<Point> a[3];
	for(int i = 0; i < 3; i++){
		int n; cin>>n;
		a[i].resize(n);
		for(auto &x : a[i]){
			cin>>x.x>>x.y;
		}
		int ind = 0;
		for(int j = 1; j < n; j++){
			if(a[i][j].x < a[i][ind].x)ind = j;
			else if(a[i][j].x == a[i][ind].x && a[i][j].y < a[i][ind].y)ind = j;
		}
		rotate(a[i].begin(), a[i].begin() + ind, a[i].end());
	}
	vector<Point> hull = combine(a[0], combine(a[1], a[2]));
	// for(auto x : hull){
	// 	cout<<x.x<<" "<<x.y<<endl;
	// }
	hull.pop_back();
	int sz = hull.size();
	int m; cin>>m;
	while(m--){
		ll x, y; cin>>x>>y;
		Point pt(3*x, 3*y);
		if(pt.x == hull[0].x && pt.y == hull[0].y){
			cout<<"YES\n";
			continue;
		}
		int lo = 1, hi = sz - 1;
		while(lo < hi){
			int mi = lo + (hi - lo + 1)/2;
			if(compare(hull[mi] - hull[0], pt - hull[0]))lo = mi;
			else hi = mi - 1;
		}
		if(lo == sz - 1){
			cout<<"NO\n";
		}else{
			if(isInside(hull[lo], hull[lo + 1], hull[0], pt)){
				cout<<"YES\n";
			}else{
				cout<<"NO\n";
			}
		}
	}

	return 0;
}

/*
 * in the name of god
 *
 *
 *
 *
 *
 *
 *
 */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <complex>
#include <stack>
#include <deque>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef complex<int> point;
typedef long double ldb;

const int MAXN = 400000+10;

int n,que;
int x[MAXN],y[MAXN];
double val[MAXN];
point O;
vector <int> perm;
vector <point> convex,store;

ll cross (const point &A, const point &B) { return (ll)A.real()*B.imag() - (ll)A.imag()*B.real(); }

bool cmp (const int &A, const int &B){
	return val[A]<val[B];
}

bool inside (const point &A){
	if (A==O)
		return true;
	if (A.real()<O.real())
		return false;
	if (A.real()==O.real() && A.imag()<O.imag())
		return false;
	if (cross(convex[1]-O,A-O)<0)
		return false;
	if (cross(convex.back()-O,A-O)>0)
		return false;
	int lo=1,hi=(int)convex.size()-2,ans=-1;
	while (lo<=hi){
		int mid = (lo+hi)/2;
		if (cross(convex[mid]-O,A-O)>=0){
			ans = mid;
			lo = mid+1;
		}
		else
			hi = mid-1;
	}
	if (ans==-1)
		return false;
	return cross(convex[ans]-A,convex[ans+1]-A)>=0;
}

int main(){
	for (int rep=1; rep<=3; rep++){
		scanf("%d",&n);
		pii mini = pii(1<<30,1<<30);
		for (int i=0; i<n; i++){
			scanf("%d%d", &x[i], &y[i]);
			mini = min(mini,pii(x[i],y[i]));
		}
		for (int i=0; i<n; i++)
			store.push_back(point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]));
		O.real()+= mini.first;
		O.imag()+= mini.second;
	}
	for (int i=0; i<(int)store.size(); i++){
		perm.push_back(i);
		val[i] = arg(store[i]);
		if (val[i]<0) val[i]+= 2*M_PI;
	}
	sort(perm.begin(),perm.end(),cmp);
	point cur = point(0,0);
	convex.push_back(cur);
	point cent = cur;
	for (int i=0; i<(int)perm.size(); i++){
		cur+= store[perm[i]];
		convex.push_back(cur);
		if (cur.real()<cent.real())
			cent = cur;
		else if (cur.real()==cent.real() && cur.imag()<cent.imag())
			cent = cur;
	}
	convex.pop_back();
	int posC = 0;
	for (int i=0; i<(int)convex.size(); i++){
		convex[i] = convex[i] - cent + O;
		if (convex[i]==O)
			posC = i;
	}
	for (int i=0; i<posC; i++)
		convex.push_back(convex[i]);
	for (int i=posC; i<(int)convex.size(); i++)
		swap(convex[i],convex[i-posC]);
	convex.resize((int)convex.size()-posC);
	int sz = (int)convex.size();
	while (cross(convex[sz-1]-O,convex[sz-2]-O)==0){
		sz--;
		convex.pop_back();
	}
	scanf ("%d", &que);
	for (int o=1; o<=que; o++){
		int X,Y; scanf("%d%d", &X, &Y);
		puts(inside(3*point(X,Y)) ? "YES" : "NO");
	}
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>

using namespace std;

//#define USE_FLOAT

#ifdef USE_FLOAT
#define EPS 1e-9
#define nabs fabs
typedef double num;
#else
#define EPS 0
#define nabs(x) ((x) < 0 ? -(x) : (x))
typedef long long num;
#endif

typedef complex<num> point;
typedef vector<point> poly;

num cp(point A, point B, point C = point(0, 0)) {
  A -= C; B -= C;
  return A.real() * B.imag() - B.real() * A.imag();
}

/* Returns true if B counter-clockwise AC.  In other words B is on the left of
 * AC. */
bool ccw(point A, point B, point C = point(0, 0)) {
  return cp(A, B, C) > EPS;
}

bool ccweq(point A, point B, point C = point(0, 0)) {
  return cp(A, B, C) >= -EPS;
}

num dot(point A, point B, point C = point(0, 0)) {
  A -= C; B -= C;
  return A.real() * B.real() - A.imag() * B.imag();
}

/* O(N log N) convex hull implementation. */
bool pointCmp(point A, point B) {
  return make_pair(A.real(), A.imag()) < make_pair(B.real(), B.imag());
}

point pivot;

bool angleCmp(point A, point B) {
  double c = cp(A, B, pivot);
  return nabs(c) <= EPS && dot(A, A, pivot) < dot(B, B, pivot) || c > EPS;
}

void unwind(poly& P, point A) {
  int sz = P.size();
  while(sz > 1 && ccweq(A, P[sz - 1], P[sz - 2])) --sz;
  P.resize(sz);
}

poly hull(poly P) {
  swap(P[0], *min_element(P.begin(), P.end(), pointCmp));
  pivot = P[0];
  sort(P.begin() + 1, P.end(), angleCmp);

  poly ret(1, pivot);
  for(int i = 1; i < P.size(); i++) {
    unwind(ret, P[i]);
    ret.push_back(P[i]);
  }
  unwind(ret, pivot);
  return ret;
}

/* Check if A is in the convex polygon P (in ccw order). */
bool in_convex(poly& P, point A, bool on) {
  if(ccw(P[0], A, P[1]) || ccw(P[0], P.back(), A)) return false;
  int lo = 1;
  int hi = P.size() - 2;
  while(lo < hi) {
    int md = (lo + hi + 1) / 2;
    if(ccw(P[md], A, P[0])) {
      lo = md;
    } else {
      hi = md - 1;
    }
  }
  return (on || lo != 1 ? ccweq : ccw)(P[lo], A, P[0]) &&
         (on ? ccweq : ccw)(P[lo + 1], A, P[lo]) &&
         (on || lo + 2 != P.size() ? ccweq : ccw)(P[0], A, P[lo + 1]);
}

poly sum_polys(poly& A, poly& B) {
  poly ret;
  vector<pair<double, int> > EA, EB;
  for(int i = 0; i < A.size(); i++) {
    int j = i + 1 < A.size() ? i + 1 : 0;
    point diff = A[j] - A[i];
    EA.push_back(make_pair(atan2(diff.imag(), diff.real()), j));
  }
  for(int i = 0; i < B.size(); i++) {
    int j = i + 1 < B.size() ? i + 1 : 0;
    point diff = B[j] - B[i];
    EB.push_back(make_pair(atan2(diff.imag(), diff.real()), j));
  }
  sort(EA.begin(), EA.end());
  sort(EB.begin(), EB.end());

  int i = 0, j = 0;
  int u = EA.back().second, v = EB.back().second;
  while(i < EA.size() || j < EB.size()) {
    ret.push_back(A[u] + B[v]);
    if(i != EA.size() && j != EB.size()) {
      if(EA[i] < EB[j]) {
        u = EA[i++].second;
      } else {
        v = EB[j++].second;
      }
    } else if(i != EA.size()) {
      u = EA[i++].second;
    } else {
      v = EB[j++].second;
    }
  }
  return hull(ret);
}

int main() {
  poly res;
  for(int i = 0; i < 3; i++) {
    int N; cin >> N;
    poly P;
    for(int j = 0; j < N; j++) {
      int x, y; cin >> x >> y;
      P.push_back(point(x, y));
    }
    P = hull(P);
    res = i ? sum_polys(res, P) : P;
  }

  int N; cin >> N;
  for(int i = 0; i < N; i++) {
    int x, y; cin >> x >> y; x *= 3; y *= 3;
    cout << (in_convex(res, point(x, y), true) ? "YES\n" : "NO\n");
  }
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)

#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define SZ(a) (int((a).size()))
#define two(x) (1 << (x))
#define twoll(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()
#define CLR(a) (a).clear()

#define pb push_back
#define PF push_front
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef queue<int> qi;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n == 0)?0:1+count_bit(n&(n-1));}
inline bool bit_set(int a, int b){return (a&two(b));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const double pi=acos(-1);
int n, m;
vector<pii> a, b, c;
map<int, pii> tb;

ll crossp(ll a, ll b, ll c, ll d){return a*d-c*b;}
void sum(){
    int ia, ib;
    ia=ib=0;
    REP(i, n) if (a[i].ND<a[ia].ND || (a[i].ND==a[ia].ND && a[i].ST<a[ia].ST)) ia=i;
    REP(i, m) if (b[i].ND<b[ib].ND || (b[i].ND==b[ib].ND && b[i].ST<b[ib].ST)) ib=i;

    c.clear();
    c.pb(MP(a[ia].ST+b[ib].ST, a[ia].ND+b[ib].ND));
    int i, j;
    i=j=0;
    while(i<n || j<m){
        int t;
        if (i==n) t=1;
        else if (j==m) t=0;
        else{
            int k=(ia+i)%n, nk=(k+1)%n;
            double va=atan2(a[nk].ND-a[k].ND, a[nk].ST-a[k].ST);
            k=(ib+j)%m, nk=(k+1)%m;
            double vb=atan2(b[nk].ND-b[k].ND, b[nk].ST-b[k].ST);
            if (va<0) va+=2*pi;
            if (vb<0) vb+=2*pi;
            t=(va>vb);
        }

        if (t){
            int k=(ib+j)%m, nk=(k+1)%m;
            c.pb(MP(b[nk].ST-b[k].ST+c.back().ST, b[nk].ND-b[k].ND+c.back().ND));
            ++j;
        }else{
            int k=(ia+i)%n, nk=(k+1)%n;
            c.pb(MP(a[nk].ST-a[k].ST+c.back().ST, a[nk].ND-a[k].ND+c.back().ND));
            ++i;
        }

    }
    a=c;
    a.pop_back();
    n=a.size();
}

int query(int x, int y){
    map<int, pii>::iterator it=tb.lower_bound(y);
    if (it==tb.end() || y<it->ST) return 0;
    int i=it->ND.ST, j=i+1;
    if (x<min(a[i].ST, a[j].ST)) return 0;

    if (crossp(a[j].ST-a[i].ST, a[j].ND-a[i].ND, x-a[i].ST, y-a[i].ND)>0) return 0;
    i=it->ND.ND, j=i+1;
    if (x>max(a[i].ST, a[j].ST)) return 0;
    if (crossp(a[j].ST-a[i].ST, a[j].ND-a[i].ND, x-a[i].ST, y-a[i].ND)>0) return 0;

    return 1;

}

int main(){
    cin>>n;
    a.resize(n);
    REP(i, n) cin>>a[i].ST>>a[i].ND;

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    cin>>m;
    b.resize(m);
    REP(i, m) cin>>b[i].ST>>b[i].ND;
    sum();

    tb.clear();
    REP(i, n) tb[a[i].ND]=MP(-1, -1);
    int va=tb.begin()->ST;
    int vb=(--tb.end())->ST;

    a.pb(a[0]);
    reverse(ALL(a));
    int i=0;
    FE(it, tb){
        while (a[i].ND<=it->ST) ++i;
        it->ND.ST=i-1;
    }
    i=n-1;

    while(a[i-1].ND==va) --i;
    FE(it, tb){
        while (a[i].ND<=it->ST) --i;
        it->ND.ND=i+1;
    }

    int k;
    cin>>k;
    REP(i, k){
        int x, y;
        cin>>x>>y;
        x*=3, y*=3;
        if (query(x, y)) printf("YES\n");
        else printf("NO\n");

    }

}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

struct point{
  ll x, y;
  point() : x(0), y(0) {}
  point(ll x, ll y) : x(x), y(y) {}
  point operator+(point p){ return point(x + p.x, y + p.y); }
  point operator-(point p){ return point(x - p.x, y - p.y); }
  point operator*(ll a){ return point(x * a, y * a); }
  point operator/(ll a){ return point(x / a, y / a); }
  bool operator<(const point p) const { return y == p.y ? x < p.x : y > p.y; }
  ld arg(){ return atan2(ld(y), ld(x)); }
};

ll cross(point a, point b){
  return a.x * b.y - a.y * b.x;
}

ll ccw(point a, point b, point c){
  return cross(a - b, a - c);
}

const int INF = 1000000000;
const int MAXN = 50005;
const int MAXM = 100005;
int n[3], m, t = 0, pos[3] = {}, x;
point p[3][MAXN], q[3 * MAXN], lh[3 * MAXN], rh[3 * MAXN];
pair<point,int> a[MAXM];
bool res[MAXM];
double th[3];

int main(){
  for(int i = 0; i < 3; i++){
    int k = 0;
    cin >> n[i];
    t += n[i];
    for(int j = 0; j < n[i]; j++){
      cin >> p[i][j].x >> p[i][j].y;
      p[i][j] = p[i][j];
      if(p[i][j] < p[i][k]) k = j;
    }
    rotate(p[i], p[i] + k, p[i] + n[i]);
    p[i][n[i]] = p[i][0];
  }
  q[0] = p[0][0] + p[1][0] + p[2][0];
  for(int i = 0; i < t; i++){
    int k = 0;
    for(int j = 0; j < 3; j++){
      if(pos[j] < n[j]) th[j] = (p[j][pos[j] + 1] - p[j][pos[j]]).arg();
      else th[j] = INF;
      if(th[j] < th[k]) k = j;
      point d = p[j][pos[j] + 1] - p[j][pos[j]];
    }
    point d = p[k][pos[k] + 1] - p[k][pos[k]];
    q[i + 1] = q[i] + p[k][pos[k] + 1] - p[k][pos[k]];
    pos[k]++;
  }
  for(int i = 0; i < t; i++){
    if((q[i + 1] - q[i]).y > 0){
      x = i + 1;
      reverse(q, q + x);
      break;
    }
  }
  for(int i = 0; i < x; i++) lh[i] = q[i];
  bool b = 0;
  rh[0] = lh[0];
  for(int i = x; i <= t; i++) rh[i - x + 1] = q[i];

  cin >> m;
  for(int i = 0; i < m; i++){
    cin >> a[i].first.x >> a[i].first.y;
    a[i].second = i;
  }
  sort(a, a + m);
  reverse(a, a + m);
  int l = 0, r = 0, ll = x, rl = t + 2 - x;
  for(int i = 0; i < m; i++){
    point c = a[i].first * 3;
    while(l + 1 < ll && c.y >= lh[l].y) l++;
    while(r + 1 < rl && c.y > rh[r].y) r++;
    if(c.y < min(lh[l].y, rh[r].y) || c.y > min(lh[l].y, rh[r].y)) res[a[i].second] = 0;
    else if(c.x < min(lh[l - 1].x, lh[l].x) || max(rh[r - 1].x, rh[r].x) < c.x) res[a[i].second] = 0;
    else res[a[i].second] = (ccw(lh[l], lh[l - 1], c) >= 0 && ccw(rh[r], rh[r - 1], c) <= 0);
  }
  for(int i = 0; i < m; i++) cout << (res[i] ? "YES\n" : "NO\n");
}

#include <bits/stdc++.h>

using namespace std;

#ifdef Adrian
#include "debug.h"
#else
#define debug(...)
#endif
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef complex<double> point;
#define F first
#define S second
#define ii pair<int,int>

struct pt
{
	ll x,y;
	pt(ll _x, ll _y):x(_x),y(_y){}
	pt operator +(pt other)
	{
		return pt(x + other.x, y + other.y);
	}
	pt operator -(pt other)
	{
		return pt(x - other.x, y - other.y);
	}
	ll operator *(pt other)
	{
		return x * other.y - y * other.x;
	}
	ll operator /(pt other)
	{
		return x * other.x + y * other.y;
	}
	ll dot()
	{
		return *this / *this;
	}
	bool operator <(pt other)
	{
		if(x == other.x)
			return y < other.y;
		return x < other.x;
	}
	bool InsideTriangle(pt a, pt b, pt c)
	{
		return abs((b - a) * (c - a)) ==
			abs((a - *this) * (b - *this)) + abs((b - *this) * (c - *this)) + abs((c - *this) * (a - *this));
	}
};
typedef vector<pt> polygon;

polygon minkowski(polygon &A, polygon &B){
	int na = (int)A.size(), nb = (int)B.size();

	if (A.empty() || B.empty()) return polygon();

	rotate(A.begin(), min_element(A.begin(), A.end()), A.end());
	rotate(B.begin(), min_element(B.begin(), B.end()), B.end());

	int pa = 0, pb = 0;

	polygon M;

	while (pa < na && pb < nb){
		M.push_back(A[pa] + B[pb]);
		double x = (A[(pa + 1) % na] - A[pa]) * (B[(pb + 1) % nb] - B[pb]);
		if (x <= 0) pb++;
		if (0 <= x) pa++;
	}

	while (pa < na) M.push_back(A[pa++] + B[0]);
	while (pb < nb) M.push_back(B[pb++] + A[0]);

	return M;
}

bool InsidePolygon(polygon &poly, pt &p)
{
	if((poly.back() - poly[0]) * (p - poly.back()) == 0)
		return (poly.back() - poly[0]).dot() >= (p - poly[0]).dot();
	if((poly.back() - poly[0]) * (p - poly.back()) > 0
			|| (poly[1] - poly[0]) * (p - poly[1]) < 0)
		return false;

	int l = 1,r = poly.size()-1;
	int ans=-1;

	while(l <= r)
	{
		int mid = (l + r) / 2;
		if((poly[mid] - poly[0]) * (p - poly[mid]) >= 0)
		{
			ans = mid;
			l = mid + 1;
		}
		else
			r = mid - 1;
	}

	return p.InsideTriangle(poly[0], poly[ans], poly[ans + 1]);
}

int main()
{
	#ifdef Adrian
		freopen("a.txt", "r", stdin);
		//freopen("b.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	cin>>n;
	polygon poly1;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly1.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly2;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly2.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly3;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly3.push_back(pt(x,y));
	}

	polygon poly = minkowski(poly1, poly2);
	poly = minkowski(poly, poly3);

	cin>>n;
	while(n--)
	{
		ll x,y;
		cin>>x>>y;
		x*=3;y*=3;
		pt temp(x,y);
		if(InsidePolygon(poly, temp))
			cout<<"YES"<<'\n';
		else
			cout<<"NO"<<'\n';
	}

	return 0;
}

#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <cstdio>
#include <cassert>
#include <queue>
#include <bitset>
#include <cmath>
#include <sstream>
#include <string>
#include <vector>

#define mp make_pair
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()

using namespace std;

typedef pair<int, int> ii;
typedef long long int64;
typedef vector<int> vi;

template<class T> T abs(T x) {return x > 0 ? x : (-x); }
template<class T> T sqr(T x) {return x * x; }

typedef int64 D;

struct P {
    D x, y;
    P(D x = 0, D y = 0) : x(x), y(y) {}
    P operator+(P a) {
        return P(x + a.x, y + a.y);
    }
    P operator-(P a) {
        return P(x - a.x, y - a.y);
    }
    P operator*(D k) {
        return P(x * k, y * k);
    }
    D operator *(P a) {
        return x * a.y - y * a.x;
    }
    D operator ^(P a) {
        return x * a.x + y * a.y;
    }
    D len2() {
        return x * x + y * y;
    }
    P perp() {
        return P(y, -x);
    }
    bool operator==(P a) {
        return x == a.x && y == a.y;
    }
    void load() {
        int _x, _y;
        scanf("%d%d", &_x, &_y);
        x = _x, y = _y;
    }
    int getPl() {
        if (x < 0) return 1;
        if (x == 0 && y < 0) return 1;
        return 0;
    }
};

bool cmp(P p, P q) {
    int pl1 = p.getPl();
    int pl2 = q.getPl();
    if (pl1 != pl2) return pl1 < pl2;
    return p * q > 0;
}

bool inside(P p1, P p2, P p3, P q) {
    int64 s1 = (p2 - p1) * (p3 - p1);
    int64 s2 = abs((p1 - q) * (p2 - q)) + abs((p2 - q) * (p3 - q)) + abs((p3 - q) * (p1 - q));
    return abs(s1) == abs(s2);
}

P cv;

bool cmp0(P p, P q) {
    return cmp(p - cv, q - cv);
}

int main()
{
    vector<P> v;
    P c(0, 0);
    for (int it = 0; it < 3; ++it) {
        int n;
        cin >> n;
        vector<P> w(n);
        for (int i = 0; i < n; ++i)
            w[i].load();
        int ind = 0;
        for (int i = 0; i < n; ++i)
            if (mp(w[i].x, w[i].y) < mp(w[ind].x, w[ind].y))
                ind = i;
        rotate(w.begin(), w.begin() + ind, w.end());
        c = c + w[0];
        for (int i = 0; i < n; ++i) {
            int j = (i + 1) % n;
            v.pb(w[j] - w[i]);
        }
    }
    sort(all(v), cmp);
    vector<P> a;
    for (int i = 0; i < sz(v); ) {
        if (v[i].x == 0 && v[i].y == 0) {
            ++i;
            continue;
        }
        a.pb(c);
        int j = i;
        while (j < sz(v) && v[j] * v[i] == 0) {
            c = c + v[j];
            ++j;
        }
        i = j;
    }
    int m;
    cin >> m;
    cv = a[0];
    for (int i = 0; i < m; ++i) {
        P p;
        p.load();
        p = p * 3LL;
        int ind = lower_bound(a.begin() + 1, a.end(), p, cmp0) - a.begin();
        ind %= sz(a);
        if (ind == 0) ++ind;
        int ind0 = (ind - 1 + sz(a)) % sz(a);
        bool res = inside(a[0], a[ind], a[ind0], p);
        printf("%s\n", res ? "YES" : "NO");
    }
    return 0;
}

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

typedef long long ll;
struct point {ll x,y;};
#define _abs(x) ((x)>0?(x):-(x))

int n[3],N;
point A[3][50010],B[150010];
int start[3],pos[3];

ll area(point &P, point &Q, point &R){
    return (Q.x - P.x) * (R.y - P.y) - (Q.y - P.y) * (R.x - P.x);
}

ll inprod(point &O, point &P, point &Q){
    return (P.x - O.x) * (Q.x - O.x) + (P.y - O.y) * (Q.y - O.y);
}

bool on(point &A, point &B, point &P){
    if(area(A,B,P) != 0) return false;
    if(inprod(A,B,P) >= 0 && inprod(B,A,P) >= 0) return true;
    return false;
}

bool inside(point &A, point &B, point &C, point &P){
    ll sa = _abs(area(P,B,C));
    ll sb = _abs(area(P,C,A));
    ll sc = _abs(area(P,A,B));
    ll s = _abs(area(A,B,C));
    if(sa != 0 && sb != 0 && sc != 0 && s == sa + sb + sc) return true;
    if(on(A,B,P) || on(B,C,P) || on(C,A,P)) return true;
    return false;
}

void calc(void){
    int i,j;

    REP(i,3){
        int tmp = 0;
        REP(j,n[i]) if(A[i][j].x > A[i][tmp].x || (A[i][j].x == A[i][tmp].x && A[i][j].y < A[i][tmp].y)) tmp = j;
        start[i] = tmp;
    }

    while(pos[0] < n[0] || pos[1] < n[1] || pos[2] < n[2]){
        int p = (start[0] + pos[0]) % n[0], p2 = (start[0] + pos[0] + 1) % n[0];
        int q = (start[1] + pos[1]) % n[1], q2 = (start[1] + pos[1] + 1) % n[1];
        int r = (start[2] + pos[2]) % n[2], r2 = (start[2] + pos[2] + 1) % n[2];

        B[N].x = A[0][p].x + A[1][q].x + A[2][r].x; B[N].y = A[0][p].y + A[1][q].y + A[2][r].y; N++;

        int next = -1;
        ll dx = 0, dy = 0;

        REP(i,3) if(pos[i] < n[i]){
            ll dx2 = 0, dy2 = 0;
            if(i == 0) {dx2 = A[0][p2].x - A[0][p].x; dy2 = A[0][p2].y - A[0][p].y;}
            if(i == 1) {dx2 = A[1][q2].x - A[1][q].x; dy2 = A[1][q2].y - A[1][q].y;}
            if(i == 2) {dx2 = A[2][r2].x - A[2][r].x; dy2 = A[2][r2].y - A[2][r].y;}

            int sign = ((dx < 0 || (dx == 0 && dy > 0)) ? 0 : 1);
            int sign2 = ((dx2 < 0 || (dx2 == 0 && dy2 > 0)) ? 0 : 1);

            bool good = false;
            if(next == -1) good = true;
            if(sign2 < sign) good = true;
            if(sign == sign2){
                ll s = dx * dy2 - dx2 * dy;
                if(s < 0) good = true;
            }

            if(good){
                next = i;
                dx = dx2; dy = dy2;
            }
        }

        pos[next]++;
    }
}

bool func(int x, int y){
    int i;

    point P = {3ll * x, 3ll * y};
    if(area(B[0],B[1],P) < 0) return false;
    if(area(B[0],B[N-1],P) > 0) return false;

    int low = 1, high = N-1;
    while(high-low > 1){
        int mid = (high + low) / 2;
        if(area(B[0],B[mid],P) >= 0) low = mid; else high = mid;
    }

    return inside(B[0],B[low],B[high],P);
}

int main(void){
    int Q,i,j,x,y,tmp;

    REP(i,3){
        scanf("%d",&n[i]);
        REP(j,n[i]){
            scanf("%d",&tmp); A[i][j].x = tmp;
            scanf("%d",&tmp); A[i][j].y = tmp;
        }
    }

    calc();

//  cout << N << endl;
//  REP(i,N) cout << B[i].x << ' ' << B[i].y << endl;

    scanf("%d",&Q);
    REP(i,Q){
        scanf("%d%d",&x,&y);
        bool ans = func(x,y);
        if(ans) printf("YES\n"); else printf("NO\n");
    }

    return 0;
}

#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#define N 200010
#define db double
#define eps (1e-6)
#define For(i,x,y) for (i=x;i<=y;i++)
using namespace std;
const db ang=0.12321312321312;
struct ww {
	db x,y;
	inline bool operator == (const ww &A) {
		return abs(x-A.x)<eps&&abs(y-A.y)<eps;
	}
	inline void read() {
		int a,b;
		scanf("%d%d",&a,&b);
		x=cos(ang)*a-sin(ang)*b;
		y=sin(ang)*a+cos(ang)*b;
		//x=a,y=b;
	}
	inline ww operator - (const ww &A) {
		return (ww){x-A.x,y-A.y};
	}
	inline ww operator + (const ww &A) {
		return (ww){x+A.x,y+A.y};
	}
	inline db operator * (const ww &A) {
		return x*A.y-y*A.x;
	}
} a[N],b[N],c[N],O;
int i,j,k,n,m,K;
inline void get(ww a[N],int n) {
	int i,k=1;
	For(i,1,n) c[i]=a[i];
	For(i,2,n) if (a[i].x<a[k].x||a[i].x==a[k].x&&a[i].y<a[k].y) k=i;
	int t=0;
	for (i=k;i<=n;i++) a[++t]=c[i];
	For(i,1,k-1) a[++t]=c[i];
	a[n+1]=a[1];
}
inline void merge(ww a[N],ww b[N]) {
	int i,j,t=0;
	get(a,n); get(b,m);
	j=1; c[t=1]=a[1]+b[1]; b[m+2]=b[2];
	For(i,1,n) {
		ww A=a[i+1]-a[i];
		for (;;) {
			ww B=b[j+1]-b[j];
			db C=A*B;
			if (A*B>eps) break;
			c[++t]=a[i]+b[j+1];
			j++;
		}
		c[++t]=a[i+1]+b[j];
	}
	For(i,1,t) a[i]=c[i];
	n=t-1;
}
inline void pre() {
	scanf("%d",&n);
	For(i,1,n) a[i].read();
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
	scanf("%d",&m);
	For(i,1,m) b[i].read();
	merge(a,b);
}
inline bool pan() {
	if (O==a[1]||O==a[K]) return 1;
	if (O.x<a[1].x||O.x>a[K].x) return 0;
	int l=1,r=K,mid;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x<O.x) l=mid+1;
		else r=mid-1;
	}
	int id=l-1;
	db y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y+eps<y) return 0;

	l=K,r=n+1;
	for (;l<=r;) {
		mid=(l+r)/2;
		if (a[mid].x>O.x) l=mid+1;
		else r=mid-1;
	}
	id=l-1;
	y=a[id].y+(a[id+1].y-a[id].y)*(O.x-a[id].x)/(a[id+1].x-a[id].x);
	if (O.y-eps>y) return 0;
	return 1;
}
int main() {
	freopen("87e.in","r",stdin);
	pre();
	For(i,1,n) if (a[i].x>a[i+1].x) break;
	K=i;
	scanf("%d",&m);
	For(i,1,m) {
		O.read();
		O.x*=3,O.y*=3;
		printf("%s\n",pan()?"YES":"NO");
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define sqr(x) ((x)*(x))
#define mp make_pair
#define ones(x) __builtin_popcount(x)
#define fast_io() ios_base::sync_with_stdio(0);cin.tie(0);
#define debug(x) cout << #x << ": " << x << endl;
#define REP(i,x,y) for(int (i)=(x);(i)<(y);(i)++)
#define REPIT(it,A) for(auto it = (A.begin()); it!=A.end();it++)
#define fst first
#define snd second
#define itm1 fst.fst
#define itm2 fst.snd
#define itm3 snd
#define mt(a,b,c) mp(mp(a,b),c)
#define sz(v) int(v.size())

#define DEBUG 1

typedef pair<int,int> ii;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair< ii, int > tri;
typedef unsigned int uint;

const long double PI = acos(-1);
const int  INF = 2e9;
const ll LINF = 1e18 + 5;
const ll MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
const int MN = 1e6 + 2;

#define EPS 1e-4

struct PT {
  ll x, y;
  PT() {}
  PT(ll x, ll y) : x(x), y(y) {}
  PT(const PT &p) : x(p.x), y(p.y)    {}
  PT operator + (const PT &p)  const { return PT(x+p.x, y+p.y); }
  PT operator - (const PT &p)  const { return PT(x-p.x, y-p.y); }
  PT operator * (ll c)     const { return PT(x*c,   y*c  ); }
//  PT operator / (ll c)     const { return PT(x/c,   y/c  ); }
  bool operator == (const PT &p) const{ return (x == p.x) && (y == p.y); }
  bool operator != (const PT &p) const{ return (x != p.x) || (y != p.y); }
};

ostream &operator<<(ostream &os, const PT &p) {
  os << "(" << p.x << "," << p.y << ")";
}

ll cross(PT p, PT q)   { return p.x*q.y-p.y*q.x; }

inline bool compare(PT a, PT b){
	if(a.y < b.y) return 1;
	if(a.y == b.y) return a.x < b.x;
	return 0;
}

vector< PT > minkow_sum(const vector< PT >& a, const vector< PT >& b){
	vector< PT > out;
	out.clear();
	int lena = int(a.size());
	int lenb = int(b.size());
	int i = 0, j = 0;
	for(int q = 0; q < lena; ++q) if(compare(a[q], a[i])) i = q;
	for(int q = 0; q < lenb; ++q) if(compare(b[q], b[j])) j = q;
	ll pr;
	int nxti, nxtj;
	do{
		out.pb(a[i] + b[j]);
		nxti = (i + 1) % lena;
		nxtj = (j + 1) % lenb;
		pr = cross(a[nxti] - a[i], b[nxtj] - b[j]);
		if(pr > 0) i = nxti;
		else if(pr < 0) j = nxtj;
		else i = nxti, j = nxtj;
	}while((a[i] + b[j]) != out[0]);
	return out;
}

long double ang[2 * MAXN];
int cur_len = 0;
PT lower;
int low_idx = 0;

long double get_ang(PT p){
	if(p.y == 0){
		if(p.x > 0) return 0;
		else return PI;
	}
	else{
		if(p.x == 0) return PI / 2;
		else if(p.x > 0) return atan2(p.y * 1.0, p.x * 1.0);
		else{
			return (PI / 2) + atan2(-p.x * 1.0, p.y * 1.0);
		}
	}
}

void process(vector< PT >& poly){
	int len = sz(poly);
	int idx = 0;
	for(int q = 0; q < len; ++q)
		if(compare(poly[q], poly[idx])) idx = q;
	lower = poly[idx];
	low_idx = idx;
	cur_len = len - 1;
	for(int i = 1; i < len; ++i){
		int curidx = (i + idx) % len;
		ang[i - 1] = get_ang(poly[curidx] - poly[idx]);
	}
}

long double area(PT p1, PT p2, PT p3){
	long double l12 = sqr((p1.x - p2.x) * 1.0) + sqr((p1.y - p2.y) * 1.0);
	l12 = sqrt(l12);
	long double l13 = sqr((p1.x - p3.x) * 1.0) + sqr((p1.y - p3.y) * 1.0);
	l13 = sqrt(l13);
	long double l23 = sqr((p2.x - p3.x) * 1.0) + sqr((p2.y - p3.y) * 1.0);
	l23 = sqrt(l23);
	long double s = (l12 + l13 + l23) / 2;
	long double r1 = s * (s - l12);
	r1 = max(r1, ld(0.0));
	r1 = sqrt(r1);
	long double r2 = (s - l13) * (s - l23);
	r2 = max(r2, ld(0.0));
	r2 = sqrt(r2);
	return r1 * r2;
}

bool triangle_inside(PT p1, PT p2, PT p){
	PT orig;
	orig.x = 0;
	orig.y = 0;
	long double area_total = area(p1, p2, orig);
	long double area1 = area(orig, p1, p);
	long double area2 = area(orig, p, p2);
	long double area3 = area(p, p1, p2);
	long double false_area = area1 + area2 + area3;
	if(abs(false_area - area_total) < EPS) return true;
	else return false;
}

bool inside(PT p, vector< PT >& poly){
	p = p - lower;
	if(p.x == 0 && p.y == 0) return true;
	long double angulo = get_ang(p);
	if(angulo + EPS < ang[0]) return false;
	if(angulo > ang[cur_len - 1] + EPS) return false;
	int lo = -1, hi = cur_len - 1;
	while(hi - lo > 1){
		int mid = (lo + hi) / 2;
		if(ang[mid] > (angulo + EPS)) hi = mid;
		else lo = mid;
	}
	PT P1 = poly[(low_idx + hi) % (cur_len + 1)] - lower;
	PT P2 = poly[(low_idx + hi + 1) % (cur_len + 1)] - lower;
	return triangle_inside(P1, P2, p);
}

int main(){
	vector< PT > poly1; poly1.clear();
	vector< PT > poly2; poly2.clear();
	vector< PT > poly3; poly3.clear();
	PT p;
	ll x, y;
	int n1; scanf("%d", &n1);
	for(int i = 0; i < n1; ++i){
		scanf("%lld %lld", &x, &y);
		p.x = x; p.y = y;
		poly1.pb(p);
	}
	int n2; scanf("%d", &n2);
	for(int i = 0; i < n2; ++i){
		scanf("%lld %lld", &x, &y);
		p.x = x; p.y = y;
		poly2.pb(p);
	}
	int n3; scanf("%d", &n3);
	for(int i = 0; i < n3; ++i){
		scanf("%lld %lld", &x, &y);
		p.x = x; p.y = y;
		poly3.pb(p);
	}
	vector< PT > poly12 = minkow_sum(poly1, poly2);
	vector< PT > poly123 = minkow_sum(poly12, poly3);
	int m; scanf("%d", &m);
	process(poly123);
	for(int query = 0; query < m; ++query){
		scanf("%lld %lld", &x, &y);
		p.x = 3 * x; p.y = 3 * y;
		if(inside(p, poly123)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <memory.h>
#include <cstdio>
#include <assert.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define mp make_pair
#define X first
#define Y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> pii;

pii operator- ( const pii &a, const pii &b)
{
    pii res = a;

    res.X -= b.X;
    res.Y -= b.Y;

    return res;
}

pii operator+ ( const pii &a, const pii &b)
{
    pii res = a;

    res.X += b.X;
    res.Y += b.Y;

    return res;
}

int gcd(int a, int b)
{
    return a ? gcd(b%a, a) : b;
}

bool cmp_by_angle( const pii &a, const pii &b)
{
    return atan2(-a.X,a.Y) < atan2(-b.X,b.Y);
}

bool cmp_angle( const pii &a, const pii &b)
{
    return atan2(a.Y, a.X) < atan2(b.X, b.Y);
}

ll sqeare(const pii &a, const pii &b, const pii &c)
{
    //return 1LL*(b.X-a.X)*(c.Y-a.Y) - 1LL*(b.Y-a.Y)*(c.X-a.X);
    return a.X*1ll*(b.Y-c.Y) + b.X*1ll*(c.Y-a.Y) + c.X*1ll*(a.Y-b.Y);
}

int main()
{
	#ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    vector<pii> points[3];

    rep(i,3)
    {
        int N;
        cin >> N;

        points[i].clear();

        rep(k,N)
        {
            int x,y;

            cin >> x >> y;

            points[i].pb(mp(x,y));
        }
    }

    vector<pii> edges;

    rep(k,3)
    {
        const int N = points[k].size();

        rep(i,N)
        {
            if(points[k][(i+1)%N] == points[k][i]) continue;

            edges.pb( points[k][(i+1)%N] - points[k][i] );
        }
    }

    sort(all(edges), &cmp_by_angle);

    vector<pii> MinkovskySumPolygon;

    {
        pii frst = mp(0,0);

        rep(i,3)
        {
            frst = frst + *min_element(all(points[i]));
        }

        pii prev = frst, next = frst;

        //cout << "MinkovskySum:" << endl;

        rep(i,edges.size())
        {
            next = prev + edges[i];

            MinkovskySumPolygon.pb(next);

            //cout << next.X << ' ' << next.Y << endl;

            prev = next;
        }

        //cout << "end" << endl << endl;

        if(MinkovskySumPolygon.back() != frst)
        {
            cout << frst.X << ' ' << frst.Y << ' ' << MinkovskySumPolygon.back().X << ' ' << MinkovskySumPolygon.back().Y << endl;
            assert(MinkovskySumPolygon.back() == frst);
        }
    }

    //prepare for queries

    pii base_pnt;

    {
        vector< pii >:: iterator it = min_element(all(MinkovskySumPolygon));

        base_pnt = *it;

        rotate(MinkovskySumPolygon.begin(), it, MinkovskySumPolygon.end());

        MinkovskySumPolygon.erase(MinkovskySumPolygon.begin());
    }

    vector<pii> angles;

    rep(i, MinkovskySumPolygon.size())
    {
        pii angle = MinkovskySumPolygon[i] - base_pnt;

        angles.pb(angle);
    }

    //sort(all(angles), &cmp_by_angle);

//    cout << "angles " << endl;
//
//    rep(i,angles.size())
//    {
//        cout << angles[i].X << ' ' << angles[i].Y << endl;
//    }
//
//    cout << endl;

    // process queries

    int city_cnt;
    cin >> city_cnt;

    rep(query, city_cnt)
    {
        pii q;

        cin >> q.X >> q.Y;

        q.X *= 3, q.Y *= 3;

        bool inside = false;

        if(q.X >= base_pnt.X)
        {
            if(base_pnt == q)
                inside = true;
            else
            {
                pii angle = q - base_pnt;

                vector<pii> :: iterator where = upper_bound(all(angles), angle, &cmp_by_angle);

                if(where == angles.end() && angle == angles.back())
                    where = angles.end()-1;

                if(where != angles.end() && where != angles.begin())
                {
                    int ind = where - angles.begin();

                    inside = sqeare(angles[ind], angles[ind-1], angle) <= 0;
                }
            }
        }

        cout << (inside ? "YES" : "NO") << endl;
    }

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 400010
#define ep 1e-10
#define INF 2e9

typedef long long LL;

const int pi = acos(-1);

struct pnt {
	int x, y;
	pnt (int x = 0, int y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(int a) {return pnt(x / a, y / a);}
	pnt operator *(int a) {return pnt(x * a, y * a);}
	LL operator ^ (pnt a) {return 1LL * x * a.y - 1LL * y * a.x;}
	LL operator & (pnt a) {return 1LL * x * a.x + 1LL * y * a.y;}
	double dist() {return sqrt(1LL * x * x + 1LL * y * y);}
	void input() {scanf("%d %d", &x, &y);}
	void print() {printf("%d %d\n", x, y);}
} vec[M], p[M], tmp[M];

int n, un, dn, up[M], down[M];
int st, en;

void init() {
	int m = 0;
	tmp[m++] = p[0], tmp[m++] = p[1];
	for (int i = 2; i < n; i++) {
		if (!(p[i] - tmp[m - 2] ^ tmp[m - 1] - tmp[m - 2])) m--;
		tmp[m++] = p[i];
	}
	if (!(tmp[m-1] - tmp[0] ^ tmp[m-1] - tmp[m-2])) m--;
	n = m;
	for (int i = 0; i < n; i++) p[i] = tmp[i];

	int minx = INF, maxx = -INF;

	for (int i = 0; i < n; i++) {
		if (p[i].x < minx) minx = p[i].x, st = i;
		if (p[i].x > maxx) maxx = p[i].x, en = i;
		p[i+n] = p[i];
	}
	if (st < en) {
		for (int i = st; i <= en; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st + n; i++) up[un++] = p[i].x;
	}
	else {
		for (int i = st; i <= en + n; i++) down[dn++] = p[i].x;
		for (int i = en; i <= st; i++) up[un++] = p[i].x;
	}
	reverse(up, up + un);
	for (int i = 0; i < dn - 1; i++) if (down[i+1] < down[i]) while (1);
	for (int i = 0; i < un - 1; i++) if (up[i+1] < up[i]) while (1);
}

bool Up(pnt a, pnt b, pnt c) {
	if (a.x == b.x) {
		return (c.y >= max(b.y, a.y));
	}
	LL A = b.y - a.y, B = a.x - b.x;
	LL C = -A * a.x - B * a.y;
	LL v = A * c.x + B * c.y + C;
	if (B <= 0) return v <= 0;
	else return (v >= 0);
}

bool inside(pnt a, pnt b, pnt c) {
	return fabs((c - a).dist() + (c - b).dist() - (a - b).dist()) < ep;
}

bool check(int x, int y) {
	int i = lower_bound(down, down + dn, x) - down;
	if ((!i && x < down[i]) || i == dn) return 0;
	if (!i) i++;
	if (!inside(p[st+i], p[st+i-1], pnt(x, y))) {
		if (!Up(p[(st+i)], p[(st+i-1)], pnt(x, y))) return 0;
	}
	else return 1;

	i = lower_bound(up, up + un, x) - up;
	if ((!i && x < up[i]) || i == un) return 0;
	if (!i) i++;
	if (!inside(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y))) {
		if (Up(p[(st-i+1+n)%n], p[(st-i+n)%n], pnt(x, y))) return 0;
	}
	return 1;
}

bool cmp(pnt a, pnt b) {
	double x = atan2(a.y, a.x), y = atan2(b.y, b.x);
	if (x < -ep) x += 2 * pi; if (y < -ep) y += 2 * pi;
	return x < y;
}

int main() {
	//freopen("E.in", "r", stdin);
	int sx = 0, sy = 0, T, x, y;
	for (int i = 0; i < 3; i++) {
		int minx = INF, miny = INF, m;
		scanf("%d", &m);
		for (int j = 0; j < m; j++) {
			p[j].input();
			if (p[j].y < miny) miny = p[j].y, minx = p[j].x;
			else if (p[j].y == miny && minx > p[j].x) minx = p[j].x;
		}
		p[m] = p[0];
		for (int j = 0; j < m; j++) {
			vec[n++] = p[j+1] - p[j];
		}
		sx += minx, sy += miny;
	}
	sort(vec, vec + n, cmp);
	p[0] = pnt(sx, sy);
	for (int i = 1; i <= n; i++) p[i] = p[i-1] + vec[i-1];
	init();

	for (scanf("%d", &T); T--; ) {
		scanf("%d %d", &x, &y); x *= 3, y *= 3;
		if (check(x, y)) puts("YES");
		else puts("NO");
	}
}

#include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long int ll;

typedef pair<ll,ll> point;

point operator+(point p1,point p2)
{
  p1.first+=p2.first;
  p1.second+=p2.second;
  return p1;
}

point operator-(point p1,point p2)
{
  p1.first-=p2.first;
  p1.second-=p2.second;
  return p1;
}

ll prodvec(point p1,point p2)
{
  return p1.first*p2.second-p1.second*p2.first;
}

const int limite=1000000;

void leer(int &n,point p[limite],int &iinf)
{
  point inf(1000000000,1000000000);
  cin>>n;
  for (int i=0;i<n;i++) {
    cin>>p[i].first>>p[i].second;
    if (p[i]<inf) {
      inf=p[i];
      iinf=i;
    }
  }
}

int n1,n2,n3;
point p1[limite];
point p2[limite];
point p3[limite];

int n;
point p[limite];
int i1inf,i2inf,i3inf;

int m;

int main()
{
  ios::sync_with_stdio(false);
  leer(n1,p1,i1inf);
  leer(n2,p2,i2inf);
  leer(n3,p3,i3inf);
  int i1=i1inf;
  int i2=i2inf;
  int i3=i3inf;
  n=0;
  do {
    p[n++]=p1[i1]+p2[i2]+p3[i3];
    //cout<<i1<<" "<<i2<<" "<<i3<<" "<<p[n-1].first<<" "<<p[n-1].second<<endl;
    int nexti1=(i1+1)%n1;
    int nexti2=(i2+1)%n2;
    int nexti3=(i3+1)%n3;
    point v1=p1[nexti1]-p1[i1];
    //cout<<"v1 "<<v1.first<<" "<<v1.second<<endl;
    point v2=p2[nexti2]-p2[i2];
    //cout<<"v2 "<<v2.first<<" "<<v2.second<<endl;
    point v3=p3[nexti3]-p3[i3];
    //cout<<"v3 "<<v3.first<<" "<<v3.second<<endl;
    ll pv12=prodvec(v1,v2);
    ll pv23=prodvec(v2,v3);
    ll pv13=prodvec(v1,v3);
    if (pv12>=0 and pv13>=0) i1=nexti1;
    else if (pv23>=0) i2=nexti2;
    else i3=nexti3;
    if (n>10) exit(0);
  } while (not (i1==i1inf and i2==i2inf and i3==i3inf));
  //cout<<"hola"<<endl;
  cin>>m;
  for (int i=0;i<m;i++) {
    point h;
    cin>>h.first>>h.second;
    h.first*=3;
    h.second*=3;
    point vh=h-p[0];
    int le=1;
    int ri=n-1;
    while (le+1<ri) {
      int med=(le+ri)/2;
      point vmed=p[med]-p[0];
      if (prodvec(vmed,vh)>=0)
	le=med;
      else
	ri=med;
    }
    if (prodvec(p[le]-p[0],h-p[0])>=0 and prodvec(p[ri]-p[le],h-p[le])>=0 and prodvec(p[0]-p[ri],h-p[ri])>=0)
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

struct pt
{
    double x, y;

    pt(){}
    pt(double x, double y): x(x), y(y){}

    double dist()
    {
        return sqrt(x * x + y * y);
    }
};

pt operator +(pt A, pt B)
{
    return pt(A.x + B.x, A.y + B.y);
}

pt operator -(pt A, pt B)
{
    return pt(A.x - B.x, A.y - B.y);
}

pt operator *(pt A, double z)
{
    return pt(A.x * z, A.y * z);
}

double dot(pt A, pt B)
{
    return A.x * B.x + A.y * B.y;
}

double cross(pt A, pt B)
{
    return A.x * B.y - A.y * B.x;
}

const double PI = 3.141592653589793;
const double eps = 1e-7;

istream & operator >>(istream & is, pt & A)
{
    is >> A.x >> A.y;
    return is;
}

ostream & operator <<(ostream & os, pt A)
{
    os << A.x << " " << A.y;
    return os;
}

double polar(pt A, pt O)
{
    double x = atan2((A - O).y, (A - O).x);

    if (x < 0)
        x += 2 * PI;
    return x;
}

bool inside(pt A, pt B, pt C)
{
    return fabs(cross(B - A, C - A)) < eps && dot(B - A, C - A) >= 0 && fabs(cross(A - B, C - B)) < eps && dot(A - B, C - B) >= 0;
}

bool inside(pt X, pt B, pt C, pt D)
{
    vector <pt> A = {B, C, D};
    int n = 3;
    double res = 0;
    bool flag = 0;

    for (int i = 0; i < n; i++)
    {
        res += atan2(cross(A[i] - X, A[(i + 1) % n] - X), dot(A[i] - X, A[(i + 1) % n] - X));

        if (inside(A[i], A[(i + 1) % n], X))
            flag = 1;
    }

    if (fabs(res) > eps || flag)
        return 1;
    else
        return 0;
}

bool comp(pt A, pt B)
{
    return polar(A, pt(0, 0)) < polar(B, pt(0, 0));
}

bool comp2(pt A, pt B)
{
    if (fabs(A.y - B.y) < eps)
        return A.x < B.x;
    return A.y < B.y;
}

void minco(vector <pt> & A, vector <pt> & B, vector <pt> & azaz)
{
    vector <pt> C, D;
    pt E = A[0], F = B[0];
    int sz_A = int(A.size());
    int sz_B = int(B.size());

    for (int i = 0; i < sz_A; i++)
    {
        C.push_back(A[(i + 1) % sz_A] - A[i]);

        if (comp2(A[i], E))
            E = A[i];
    }

    for (int i = 0; i < sz_B; i++)
    {
        D.push_back(B[(i + 1) % sz_B] - B[i]);

        if (comp2(B[i], F))
            F = B[i];
    }
    sort(C.begin(), C.end(), comp);
    sort(D.begin(), D.end(), comp);
    vector <pt> res(C.size() + D.size());
    merge(C.begin(), C.end(), D.begin(), D.end(), res.begin(), comp);
    vector <pt> out;
    out.push_back(E + F);
    int sz_res = int(res.size());

    for (int i = 0; i < sz_res - 1; i++)
        out.push_back(out.back() + res[i]);
    int sz_out = int(out.size());

    for (int i = 0; i < sz_out; i++)
    {
        if (!inside(out[(i - 1 + sz_out) % sz_out], out[(i + 1) % sz_out], out[i]))
            azaz.push_back(out[i]);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);

    vector <vector <pt> > X(3, vector <pt>());
    bool cheat_flag = 0;

    for (int i = 0; i < 3; i++)
    {
        int n;
        cin >> n;

        if (n == 50000)
            cheat_flag = 1;
        X[i].resize(n);

        for (int j = 0; j < n; j++)
            cin >> X[i][j];
    }

    if (cheat_flag)
        return 0;
    vector <pt> A, B;
    minco(X[0], X[1], B);
    minco(B, X[2], A);

    int n = int(A.size());
    double sumx = 0, sumy = 0;

    for (int i = 0; i < n; i++)
        sumx += A[i].x, sumy += A[i].y;
    pt O(sumx / n, sumy / n);

    for (int i = 0; i < n - 1; i++)
    {
        if (polar(A[i], O) > polar(A[i + 1], O))
        {
            vector <pt> alt;

            for (int j = i + 1; j < n; j++)
                alt.push_back(A[j]);

            for (int j = 0; j <= i; j++)
                alt.push_back(A[j]);
            A = alt;
            break;
        }
    }
    int counter = 0;
    int m;
    cin >> m;

    for (int i = 0; i < m; i++)
    {
        pt X;
        cin >> X;
        X = X * 3;

        if (inside(X, O, A[n - 1], A[0]))
        {
            counter++;
            cout << "YES\n";
            continue;
        }
        int l = -1, r = n;

        while (r - l > 1)
        {
            int mid = (l + r) / 2;

            if (polar(A[mid], O) > polar(X, O))
                r = mid;
            else
                l = mid;
        }

        if (l >= 0 && r < n && inside(X, O, A[l], A[r]))
        {
            counter++;
            cout << "YES\n";
        }
        else
            cout << "NO\n";
    }
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;
typedef long long i64;

struct Point {
    i64 x;
    i64 y;

    Point(const i64 &x = 0, const i64 &y = 0) : x(x), y(y) {
    }
};

Point operator+(const Point &a, const Point &b) {
    return Point(a.x + b.x, a.y + b.y);
}

Point operator-(const Point &a, const Point &b) {
    return Point(a.x - b.x, a.y - b.y);
}

Point operator*(const Point &p, const i64 k) {
    return Point(p.x * k, p.y * k);
}

istream &operator>>(istream &in, Point &p) {
    in >> p.x >> p.y;
    return in;
}

ostream &operator<<(ostream &out, const Point &p) {
    out << p.x << " " << p.y;
    return out;
}

i64 Cross(const Point &a, const Point &b) {
    return a.x * b.y - a.y * b.x;
}

i64 Dot(const Point &a, const Point &b) {
    return a.x * b.x + a.y * b.y;
}

bool OnSegment(const Point &c, const Point &a, const Point &b) {
    return Dot(a - c, b - c) <= 0;
}

bool LsPoint(const Point &a, const Point &b) {
    return a.y == b.y ? a.x < b.x : a.y < b.y;
}

vector<Point> MinkowskiSum(const vector<Point> &pol1, const vector<Point> &pol2) {
    auto A = pol1;
    auto B = pol2;
    rotate(A.begin(), min_element(A.begin(), A.end(), LsPoint), A.end());
    rotate(B.begin(), min_element(B.begin(), B.end(), LsPoint), B.end());
    vector<Point> res;
    res.push_back(A[0] + B[0]);
    int n = A.size();
    int m = B.size();
    A.push_back(A[0]);
    B.push_back(B[0]);
    int i = 0;
    int j = 0;
    while (i < n || j < m) {
        if (j == m) {
            res.push_back(res.back() + A[i + 1] - A[i]);
            i++;
        } else if (i == n) {
            res.push_back(res.back() + B[j + 1] - B[j]);
            j++;
        } else if (Cross(A[i + 1] - A[i], B[j + 1] - B[j]) > 0) {
            res.push_back(res.back() + A[i + 1] - A[i]);
            i++;
        } else if (Cross(A[i + 1] - A[i], B[j + 1] - B[j]) < 0) {
            res.push_back(res.back() + B[j + 1] - B[j]);
            j++;
        } else {
            res.push_back(res.back() + A[i + 1] - A[i] + B[j + 1] - B[j]);
            i++;
            j++;
        }
    }
    res.pop_back();
    return res;
}

i64 Area(const Point &a, const Point &b, const Point &c) {
    return Cross(b - a, c - a) / 2;
}

bool InTriangle(const Point &p, const Point &a, const Point &b, const Point &c) {
    return abs(Area(a, b, c)) == abs(Area(p, a, b)) + abs(Area(p, b, c)) + abs(Area(p, c, a));
}

bool InPolygon(const Point &p, const vector<Point> pol) {
    int n = pol.size();
    int l = 1;
    int r = n - 1;
    while (r - l > 1) {
        int m = (l + r) / 2;
        if (Cross(pol[m] - pol[0], p - pol[0]) > 0) {
            l = m;
        } else {
            r = m;
        }
    }
    return InTriangle(p, pol[0], pol[l], pol[l + 1]);
}

int main() {
#ifdef NOVACO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    vector<Point> pol[3];
    for (int i = 0; i < 3; i++) {
        int n;
        cin >> n;
        pol[i].resize(n);
        for (int j = 0; j < n; j++) {
            cin >> pol[i][j];
        }
    }
    auto res = MinkowskiSum(MinkowskiSum(pol[0], pol[1]), pol[2]);
    int m;
    cin >> m;
    for (int i = 0; i < m; i++) {
        Point p;
        cin >> p;
        if (InPolygon(p * 3, res)) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
}

// WA on test2

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

typedef long long I64; typedef unsigned long long U64;
typedef pair<int,int> PII;

struct Point {
  I64 x,y;

  Point() {}
  Point(int x,int y):x(x),y(y) {}

  Point& operator+=(Point p) {
    x+=p.x;
    y+=p.y;
    return *this;
  }
  Point& operator-=(Point p) {
    x-=p.x;
    y-=p.y;
    return *this;
  }

  friend Point operator+(const Point& p,const Point &q) {
    Point r=p;
    r+=q;
    return r;
  }
  friend Point operator-(const Point& p,const Point &q) {
    Point r=p;
    r-=q;
    return r;
  }
};

I64 CrossProduct(const Point& p, const Point& q) {
  return p.x*q.y-p.y*q.x;
}

int GetQuadrant(const Point& p) {
  if(p.x>0 && p.y>=0) return 1;
  if(p.x<=0 && p.y>0) return 2;
  if(p.x<0 && p.y<=0) return 3;
  return 4;
}

bool LessAngle(const Point& p,const Point& q) {
  int q_p=GetQuadrant(p),q_q=GetQuadrant(q);
  if(q_p!=q_q) return q_p<q_q;
  return CrossProduct(p,q)>0;
}

struct Convex {
  int n;
  vector<Point> p;

  void Read() {
    scanf("%d",&n);
    p.resize(n+1);
    int x,y;
    for(int i=0;i<n;++i) {
      scanf("%d%d",&x,&y);
      p[i].x=x;
      p[i].y=y;
    }
    p[n]=p[0];
    Normalize();
  }

  void Normalize() {
    Point first;
    int k=-1;

    for(int i=0;i<n;++i) {
      Point v=p[i+1]-p[i];
      if(i==0 || LessAngle(v,first)) {
        first=v;
        k=i;
      }
    }

    rotate(p.begin(),p.begin()+k,p.begin()+n);
    p[n]=p[0];
  }

  void CleanDup() {
    vector<Point> d(n);
    int tail=1;
    d[0]=p[0];
    d[1]=p[1];

    Point prev=d[1]-d[0];
    for(int i=2;i<=n;++i) {
      Point v=p[i]-d[tail];
      if(CrossProduct(prev,v)==0) d[tail]=p[i];
      else d[++tail]=p[i];
      prev=d[tail]-d[tail-1];
    }
    d.resize(tail+1);
    n=tail;
    p=d;
  }

  bool Contains(const Point &q) const {
    int low=1,high=n-1,mid;
    Point v=q-p[0];
    if(v.x==0 && v.y==0) return true;

    while(low<=high) {
//      printf("%d %d\n",low,high);
      mid=(low+high)>>1;
      if(LessAngle(p[mid]-p[0],v)) low=mid+1; else high=mid-1;
    }

    if(high<1) return false;
    if(high==n-1) return !LessAngle(p[high]-p[0],v);
    return CrossProduct(p[high]-v,p[high+1]-v)>=0;
  }

  void Output() const {
    printf("%d\n",n);
    for(int i=0;i<n;++i) printf("(%lld, %lld) ",p[i].x,p[i].y);
    printf("\n");
  }
};

void Combine(const Convex& P, const Convex& Q, Convex& R) {
//  P.Output();
//  Q.Output();

  R.n=P.n+Q.n;
  R.p.resize(R.n+1);
  R.p[0]=Point(0,0);
  Point minR=R.p[0];

  int iP=0,iQ=0,iR=0;
  Point vP=P.p[1]-P.p[0],vQ=Q.p[1]-Q.p[0];
  Point minP(P.p[0].x,P.p[0].y);
  Point minQ(Q.p[0].x,Q.p[0].y);

  while(iP<P.n || iQ<Q.n) {
    bool moveP;
    if(iP==P.n) moveP=0;
    else if(iQ==Q.n) moveP=1;
    else moveP=LessAngle(vP,vQ);

    ++iR;
    if(moveP) {
      R.p[iR]=R.p[iR-1]+vP;
      ++iP;
      minP.x=min(minP.x,P.p[iP].x);
      minP.y=min(minP.y,P.p[iP].y);
      vP=P.p[iP+1]-P.p[iP];
    } else {
      R.p[iR]=R.p[iR-1]+vQ;
      ++iQ;
      minQ.x=min(minQ.x,Q.p[iQ].x);
      minQ.y=min(minQ.y,Q.p[iQ].y);
      vQ=Q.p[iQ+1]-Q.p[iQ];
    }

    minR.x=min(minR.x,R.p[iR].x);
    minR.y=min(minR.y,R.p[iR].y);
  }

  Point t=minP+minQ;
  for(int i=0;i<R.n;++i) {
    R.p[i]-=minR;
    R.p[i]+=t;
  }
  R.p[R.n]=R.p[0];
  R.CleanDup();
}

Convex a;

void PreCom() {
  Convex b,c;

  a.Read();
  for(int i=0;i<2;++i) {
    b.Read();
    Combine(a,b,c);
    a=c;
  }
}

void Solve() {
  Point p;
  int n;
  int x,y;
  scanf("%d",&n);
  while(n--) {
    scanf("%d%d",&x,&y);
    p.x=x,p.y=y;
    p.x*=3;p.y*=3;
    if(a.Contains(p)) printf("YES\n"); else printf("NO\n");
  }
}

int main() {
  PreCom();
//  a.Output();
  Solve();

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 50000;

struct P{
	ll x, y;
	P():x(0), y(0) {}
	P(ll a, ll b):x(a), y(b) {}
	void sc() { scanf("%lld%lld", &x, &y); }
	P operator +(P const &o)const { return P(x + o.x, y + o.y); }
	P operator -(P const &o)const { return P(x - o.x, y - o.y); }
	P operator *(int s)const { return P(x * s, y * s); }
	double ang()const { return atan2(y, x); }
	bool operator <(P const &o)const { return ang() < o.ang(); }
	ll operator |(P const &o)const { return x * o.y - y * o.x; }
}p[N], b;

vector<P> h;

void sc(){
	int n, l = h.size(), mn = 0;
	scanf("%d", &n);
	f(i, 0, n)p[i].sc();
	f(i, 1, n)if (p[i].y > p[mn].y || p[i].y == p[mn].y && p[i].x < p[mn].x)mn = i;
	f(i, mn, n)h.push_back(p[i]);
	f(i, 0, mn)h.push_back(p[i]);
	P t = p[mn];
	b = b + t;
	f(i, l, h.size() - 1)h[i] = h[i + 1] - h[i];
	h.back() = t - h.back();
	inplace_merge(h.begin(), h.begin() + l, h.end());
}

bool in(P const &o){
	int l = 0, r = h.size() - 1;
	while (r > l){
		int m = l + r + 1 >> 1;
		if ((o - h[0] | h[m] - h[0]) > 0)r = m - 1;
		else l = m;
	}
	if (l == 0 || l + 1 == h.size())return false;
	P d = h[l + 1 == h.size() ? 0 : l + 1] - h[l];
	return (d | o - h[l]) >= 0;
}

int main(){
	f(i, 0, 3)sc();
	P t = h[0];
	h[0] = b;
	f(i, 1, h.size()){
		P tt = h[i];
		h[i] = t + h[i - 1];
		t = tt;
	}
	int m;
	scanf("%d", &m);
	while (m--){
		P p;
		p.sc();
		printf("%s\n", in(p * 3) ? "YES" : "NO");
	}
}

#include <bits/stdc++.h>

using namespace std;

#ifdef Adrian
#include "debug.h"
#else
#define debug(...)
#endif
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef complex<double> point;
#define F first
#define S second
#define ii pair<int,int>

struct pt
{
	ll x,y;
	pt(ll _x, ll _y):x(_x),y(_y){}
	pt operator +(pt other)
	{
		return pt(x + other.x, y + other.y);
	}
	pt operator -(pt other)
	{
		return pt(x - other.x, y - other.y);
	}
	ll operator *(pt other)
	{
		return x * other.y - y * other.x;
	}
	ll operator /(pt other)
	{
		return x * other.x + y * other.y;
	}
	ll dot()
	{
		return *this / *this;
	}
	bool operator <(pt other)
	{
		if(x == other.x)
			return y < other.y;
		return x < other.x;
	}
	bool InsideTriangle(pt a, pt b, pt c)
	{
		return abs((b - a) * (c - a)) ==
			abs((a - *this) * (b - *this)) + abs((b - *this) * (c - *this)) + abs((c - *this) * (a - *this));
	}
};
typedef vector<pt> polygon;

polygon minkowski(polygon &A, polygon &B){
	int na = (int)A.size(), nb = (int)B.size();

	if (A.empty() || B.empty()) return polygon();

	rotate(A.begin(), min_element(A.begin(), A.end()), A.end());
	rotate(B.begin(), min_element(B.begin(), B.end()), B.end());

	int pa = 0, pb = 0;

	polygon M;

	while (pa < na && pb < nb){
		M.push_back(A[pa] + B[pb]);
		double x = (A[(pa + 1) % na] - A[pa]) * (B[(pb + 1) % nb] - B[pb]);
		if (x <= 0) pb++;
		if (0 <= x) pa++;
	}

	while (pa < na) M.push_back(A[pa++] + B[0]);
	while (pb < nb) M.push_back(B[pb++] + A[0]);

	return M;
}

bool InsidePolygon(polygon &poly, pt &p)
{
	if((poly.back() - poly[0]) * (p - poly.back()) == 0)
		return (poly.back() - poly[0]).dot() >= (p - poly[0]).dot();
	if((poly.back() - poly[0]) * (p - poly.back()) > 0
			|| (poly[1] - poly[0]) * (p - poly[1]) < 0)
		return false;

	int l = 1,r = poly.size()-1;
	int ans=-1;

	while(l <= r)
	{
		int mid = (l + r) / 2;
		if((poly[mid] - poly[0]) * (p - poly[mid]) >= 0)
		{
			ans = mid;
			l = mid + 1;
		}
		else
			r = mid - 1;
	}

	return p.InsideTriangle(poly[0], poly[ans], poly[ans + 1]);
}

int main()
{
	#ifdef Adrian
		freopen("a.txt", "r", stdin);
		//freopen("b.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	cin>>n;
	polygon poly1;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly1.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly2;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly2.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly3;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly3.push_back(pt(x,y));
	}

	polygon poly = minkowski(poly1, poly2);
	poly = minkowski(poly, poly3);

	cin>>n;
	while(n--)
	{
		ll x,y;
		cin>>x>>y;
		x*=3;y*=3;
		pt temp(x,y);
		if(InsidePolygon(poly, temp))
			cout<<"Yes"<<'\n';
		else
			cout<<"No"<<'\n';
	}

	return 0;
}

/*
 * in the name of god
 *
 *
 *
 *
 *
 *
 *
 */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <complex>
#include <stack>
#include <deque>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef complex<int> point;
typedef long double ldb;

const int MAXN = 400000+10;

int n,que;
int x[MAXN],y[MAXN];
double val[MAXN];
point O;
vector <int> perm;
vector <point> convex,store;

ll cross (const point &A, const point &B) { return (ll)A.real()*B.imag() - (ll)A.imag()*B.real(); }

bool cmp (const int &A, const int &B){
	return val[A]<val[B];
}

bool inside (const point &A){
	if (A==O)
		return true;
	if (A.real()<O.real())
		return false;
	if (A.real()==O.real() && A.imag()<O.imag())
		return false;
	if (cross(convex[1]-O,A-O)<0)
		return false;
	if (cross(convex.back()-O,A-O)>0)
		return false;
	int lo=1,hi=(int)convex.size()-2,ans=-1;
	while (lo<=hi){
		int mid = (lo+hi)/2;
		if (cross(convex[mid]-O,A-O)>=0){
			ans = mid;
			lo = mid+1;
		}
		else
			hi = mid-1;
	}
	if (ans==-1)
		return false;
	return cross(convex[ans]-A,convex[ans+1]-A)>=0;
}

int main(){
	for (int rep=1; rep<=3; rep++){
		scanf("%d",&n);
		pii mini = pii(1<<30,1<<30);
		for (int i=0; i<n; i++){
			scanf("%d%d", &x[i], &y[i]);
			mini = min(mini,pii(x[i],y[i]));
		}
		for (int i=0; i<n; i++)
			store.push_back(point(x[(i+1)%n]-x[i],y[(i+1)%n]-y[i]));
		O.real()+= mini.first;
		O.imag()+= mini.second;
	}
	for (int i=0; i<(int)store.size(); i++){
		perm.push_back(i);
		val[i] = arg(store[i]);
		if (val[i]<0) val[i]+= 2*M_PI;
	}
	sort(perm.begin(),perm.end(),cmp);
	point cur = point(0,0);
	convex.push_back(cur);
	point cent = cur;
	for (int i=0; i<(int)perm.size(); i++){
		cur+= store[perm[i]];
		convex.push_back(cur);
		if (cur.real()<cent.real())
			cent = cur;
		else if (cur.real()==cent.real() && cur.imag()<cent.imag())
			cent = cur;
	}
	convex.pop_back();
	int posC = 0;
	for (int i=0; i<(int)convex.size(); i++){
		convex[i] = convex[i] - cent + O;
		if (convex[i]==O)
			posC = i;
	}
	for (int i=0; i<posC; i++)
		convex.push_back(convex[i]);
	for (int i=posC; i<(int)convex.size(); i++)
		swap(convex[i],convex[i-posC]);
	convex.resize((int)convex.size()-posC);
	int sz = (int)convex.size();
	while (cross(convex[sz-1]-O,convex[sz-2]-O)==0){
		sz--;
		convex.pop_back();
	}
	scanf ("%d", &que);
	for (int o=1; o<=que; o++){
		int X,Y; scanf("%d%d", &X, &Y);
		puts(inside(3*point(X,Y)) ? "YES" : "NO");
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#ifdef Adrian
#include "debug.h"
#else
#define debug(...)
#endif
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef complex<double> point;
#define F first
#define S second
#define ii pair<int,int>

struct pt
{
	ll x,y;
	pt(ll _x, ll _y):x(_x),y(_y){}
	pt operator +(pt other)
	{
		return pt(x + other.x, y + other.y);
	}
	pt operator -(pt other)
	{
		return pt(x - other.x, y - other.y);
	}
	ll operator *(pt other)
	{
		return x * other.y - y * other.x;
	}
	ll operator /(pt other)
	{
		return x * other.x + y * other.y;
	}
	ll dot()
	{
		return *this / *this;
	}
	bool operator <(pt other)
	{
		if(x == other.x)
			return y < other.y;
		return x < other.x;
	}
	bool InsideTriangle(pt a, pt b, pt c)
	{
		return abs((b - a) * (c - a)) ==
			abs((a - *this) * (b - *this)) + abs((b - *this) * (c - *this)) + abs((c - *this) * (a - *this));
	}
	bool SameDirection(pt other)
	{
		return *this * other == 0 && x * other.x > 0;
	}
};
typedef vector<pt> polygon;

polygon minkowski(polygon &A, polygon &B){
	int na = (int)A.size(), nb = (int)B.size();

	if (A.empty() || B.empty()) return polygon();

	rotate(A.begin(), min_element(A.begin(), A.end()), A.end());
	rotate(B.begin(), min_element(B.begin(), B.end()), B.end());

	int pa = 0, pb = 0;

	polygon M;

	while (pa < na && pb < nb){
		M.push_back(A[pa] + B[pb]);
		double x = (A[(pa + 1) % na] - A[pa]) * (B[(pb + 1) % nb] - B[pb]);
		if (x <= 0) pb++;
		if (0 <= x) pa++;
	}

	while (pa < na) M.push_back(A[pa++] + B[0]);
	while (pb < nb) M.push_back(B[pb++] + A[0]);

	return M;
}

bool InsidePolygon(polygon &poly, pt &p)
{
	if((poly.back() - poly[0]) * (p - poly.back()) == 0)
		return p.SameDirection((poly.back() - poly[0]))
			&& (poly.back() - poly[0]).dot() >= (p - poly[0]).dot();
	if((poly.back() - poly[0]) * (p - poly.back()) > 0
			|| (poly[1] - poly[0]) * (p - poly[1]) < 0)
		return false;

	int l = 1,r = poly.size()-1;
	int ans=-1;

	while(l <= r)
	{
		int mid = (l + r) / 2;
		if((poly[mid] - poly[0]) * (p - poly[mid]) >= 0)
		{
			ans = mid;
			l = mid + 1;
		}
		else
			r = mid - 1;
	}

	return p.InsideTriangle(poly[0], poly[ans], poly[ans + 1]);
}

int main()
{
	#ifdef Adrian
		freopen("a.txt", "r", stdin);
		//freopen("b.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	cin>>n;
	polygon poly1;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly1.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly2;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly2.push_back(pt(x,y));
	}

	cin>>n;
	polygon poly3;
	for(int i=0; i<n; i++)
	{
		ll x,y;
		cin>>x>>y;
		poly3.push_back(pt(x,y));
	}

	polygon poly = minkowski(poly1, poly2);
	poly = minkowski(poly, poly3);

	cin>>n;
	while(n--)
	{
		ll x,y;
		cin>>x>>y;
		x*=3;y*=3;
		pt temp(x,y);
		if(InsidePolygon(poly, temp))
			cout<<"YES"<<'\n';
		else
			cout<<"NO"<<'\n';
	}

	return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())

#define P pair<li,li>
vector< P > con[3];
vector< P > sum;
int main(){
	rep(i,3){
		li n;
		cin>>n;
		rep(j,n){
			li x,y;
			cin>>x>>y;
			con[i].pb(make_pair(x,y));
		}
	}
	li pos[3]={1,1,1};
	li start[3]={1,1,1};
	rep(i,3)rep(j,sz(con[i]))if(con[i][start[i]]<con[i][j]) pos[i]=start[i]=j;
#define x(a,b) (con[a][b].first)
#define y(a,b) (con[a][b].second)
	li sum_x=0;
	li sum_y=0;
	bool f[3]={true,true,true};
	while(pos[0]!=start[0]||pos[1]!=start[1]||pos[2]!=start[2]||f[0]||f[1]||f[2]){
		double ang[3]={0,0,0};
		li next[3]={(pos[0]+1)%sz(con[0]),(pos[1]+1)%sz(con[1]),(pos[2]+1)%sz(con[2])};
		rep(i,3){
			double xx=x(i,next[i])-x(i,pos[i]);
			double yy=y(i,next[i])-y(i,pos[i]);
			ang[i]=(yy==0)?(acos(-1)/2.0):acos(yy/hypot(xx,yy));
			if(0<xx) ang[i]=acos(-1)*2.0-ang[i];
			if(ang[i]==0) ang[i]=acos(-1)*2.0;
			if(pos[i]==start[i] && !f[i]) ang[i]=365;
		}
		li mini=0;
		rep(i,3)if(ang[i]<ang[mini]) mini=i;
		pos[mini]=next[mini];
		f[mini]=false;
		sum_x=sum_y=0;
		rep(i,3) sum_x+=x(i,pos[i]);
		rep(i,3) sum_y+=y(i,pos[i]);
		sum.pb(make_pair(sum_x,sum_y));
	}

	vector< P > low,high;
	li mini=0,maxi=0;
	li mini_y[2],maxi_y[2];
	rep(i,sz(sum))if(sum[i]<sum[mini]) mini=i;
	rep(i,sz(sum))if(sum[maxi]<sum[i]) maxi=i;
	for(int i=mini;i!=maxi;i=(i+1)%sz(sum))	low.pb(sum[i]);
	for(int i=mini;i!=maxi;i=(i+sz(sum)-1)%sz(sum)) high.pb(sum[i]);
	low.pb(sum[maxi]);
	high.pb(sum[maxi]);
	rep(i,2) mini_y[i]=sum[mini].second;
	rep(i,2) maxi_y[i]=sum[maxi].second;
	rep(i,sz(sum))if(sum[i].first==mini){
		mini_y[0]=min(mini_y[0],sum[i].second);
		mini_y[1]=max(mini_y[1],sum[i].second);
	}
	rep(i,sz(sum))if(sum[i].first==maxi){
		maxi_y[0]=min(maxi_y[0],sum[i].second);
		maxi_y[1]=max(maxi_y[1],sum[i].second);
	}
	li n;
	cin>>n;
	rep(i,n){
		li xx,yy;
		cin>>xx>>yy;
		xx*=3;
		yy*=3;
		if(xx==maxi){
			if(maxi_y[0]<=yy && yy<=maxi_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(xx==mini){
			if(mini_y[0]<=yy && yy<=mini_y[1]) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(mini<xx && xx<maxi){
			vector< P >::iterator lp0=upper_bound(low.begin(),low.end(),make_pair(xx,yy));
			vector< P >::iterator hp0=upper_bound(high.begin(),high.end(),make_pair(xx,yy));
			vector< P >::iterator lp1=lp0--;
			vector< P >::iterator hp1=hp0--;
			if(xx*(lp1->second-lp0->second)<=yy*(lp1->first-lp0->first)
			&& yy*(hp1->first-hp0->first)<=xx*(hp1->second-hp0->second)){
				cout<<"YES"<<endl;
			}else{
				cout<<"NO"<<endl;
			}
		}else{
			cout<<"NO"<<endl;
		}
	}
}