#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define FOREQ(i, s, n) for (ll i = (s); i <= (ll)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

struct Hexagon {
  ll vs[3][2];
  Hexagon() {;}
};

Hexagon S;
Hexagon territory[40010];
deque<pair<ll, ll> > dists1[3][2];
deque<pair<ll, ll> > dists2[3][2];
ll state[40010];

void Expand(ll index) {
  Hexagon s = territory[index];
  REP(k, 3) {
    s.vs[k][0]--;
    s.vs[k][1]++;
  }
  REP(k, 3) REP(type, 2) {
    S.vs[k][0] = min(S.vs[k][0], s.vs[k][type]);
    S.vs[k][1] = max(S.vs[k][1], s.vs[k][type]);
  }
}

ll Check() {
  ll ret = 0;
  REP(k, 3) {
    REP(type, 2) {
      while (!dists1[k][type].empty()) {
        ll d = S.vs[k][type ^ 1];
        if (type == 0) {
          if (dists1[k][0].front().first > d) { break; }
        } else {
          if (d > -dists1[k][1].front().first) { break; }
        }
        ll index = dists1[k][type].front().second;
        state[index] |= 1 << (k * 2 + type);
        //cout << index << " " << k * 2 + type << endl;
        //cout << state[index] << " " << (1 << 7) - 1 << endl;
        if (state[index] == (1 << 7) - 1) {
          state[index] = 0;
          Expand(index);
          ret++;
        }
        dists1[k][type].pop_front();
      }
      while (!dists2[k][type].empty()) {
        ll d = S.vs[k][type];
        if (type == 0) {
          if (-dists2[k][type].front().first < d) { break; }
        } else {
          if (d < dists2[k][type].front().first) { break; }
        }
        ll index = dists2[k][type].front().second;
        //cout << index << endl;
        state[index] |= 1 << 6;
        if (state[index] == (1 << 7) - 1) {
          state[index] = 0;
          Expand(index);
          ret++;
        }
        dists2[k][type].pop_front();
      }
    }
  }
  return ret;
}

ll n, q;
int main() {
  while (scanf("%lld", &n) > 0) {
    MEMSET(state, 0);
    REP(k, 3) REP(type, 2) {
      dists1[k][type].clear();
      dists2[k][type].clear();
    }
    REP(i, n) {
      Hexagon hex;
      REP(j, 3) {
        hex.vs[j][0] = 1LL << 60;
        hex.vs[j][1] = -(1LL << 60);
      }
      REP(j, 6) {
        ll x, y;
        scanf("%lld %lld", &x, &y);
        ll z = x + y;
        ll v[3] = { x, y, z };
        REP(k, 3) {
          hex.vs[k][0] = min(hex.vs[k][0], v[k]);
          hex.vs[k][1] = max(hex.vs[k][1], v[k]);
        }
      }
      territory[i] = hex;
      REP(k, 3) {
        dists1[k][0].push_back(make_pair(hex.vs[k][0], i));
        dists1[k][1].push_back(make_pair(-hex.vs[k][1], i));
        dists2[k][0].push_back(make_pair(-hex.vs[k][0], i));
        dists2[k][1].push_back(make_pair(hex.vs[k][1], i));
      }
    }
    REP(k, 3) REP(type, 2) {
      sort(dists1[k][type].begin(), dists1[k][type].end());
      sort(dists2[k][type].begin(), dists2[k][type].end());
    }
    REP(k, 3) REP(l, 2) { S.vs[k][l] = 0; }
    while (Check()) {;}
    // REP(k, 3) {
    //   cout << S.vs[k][0] << " " << S.vs[k][1] << endl;
    // }
    scanf("%lld", &q);
    REP(i, q) {
      ll x, y;
      scanf("%lld %lld", &x, &y);
      ll z = x + y;
      if (S.vs[0][0] <= x && x <= S.vs[0][1] &&
          S.vs[1][0] <= y && y <= S.vs[1][1] &&
          S.vs[2][0] <= z && z <= S.vs[2][1]) {
        puts("YES");
      } else {
        puts("NO");
      }
    }
  }
}

Measured memory_bytes: 10000