Problem: A long time ago somewhere in the depths of America existed a powerful tribe governed by the great leader Pinnie-the-Wooh. Once the tribe conquered three Maya cities. Pinnie-the-Wooh grew concerned: there had to be some control over the conquered territories. That's why he appealed to the priests of the supreme god Mogohu-Rea for help.

The priests conveyed the god's will to him: to control these three cities he should put an idol to Mogohu-Rea — that will create a religious field over the cities. However, the idol is so powerful that it can easily drive the people around it mad unless it is balanced by exactly three sacrifice altars, placed one in each city. To balance the idol the altars should be placed so that the center of mass of the system of these three points coincided with the idol. When counting the center of mass consider that all the altars have the same mass.

Now Pinnie-the-Wooh is thinking where to put the idol. He has a list of hills, that are suitable to put an idol there. Help him to identify on which of them you can put an idol without risking to fry off the brains of the cities' population with the religious field.

Each city has a shape of a convex polygon such that no three vertexes lie on a straight line. The cities can intersect. Each altar should be attached to the city through a special ceremony, besides, it must be situated on the city's territory (possibly at the border). Thus, there may be several altars on a city's territory, but exactly one of them will be attached to the city. The altars, the idol and the hills are points on the plane, some of them may coincide.

The hills are taken into consideration independently from each other, the altars' location for different hills may also be different.

Input

First follow descriptions of the three cities, divided by empty lines. The descriptions are in the following format:

The first line contains an integer n, which represent the number of the polygon's vertexes (3 ≤ n ≤ 5·104). Next n lines contain two integers xi, yi each, they are the coordinates of the polygon's i-th vertex in the counterclockwise order.

After the cities' description follows the integer m (1 ≤ m ≤ 105), which represents the number of hills. Next m lines each contain two integers xj, yj, they are the coordinates of the j-th hill.

All the coordinates in the input data do not exceed 5·108 in the absolute value.

Output

For each hill print on a single line "YES" (without the quotes) or "NO" (without the quotes), depending on whether the three sacrifice altars can be put to balance the idol or not.

Examples

Input

3
0 0
1 0
1 1

4
8 8
5 5
6 4
8 4

3
-1 -1
-3 -1
-2 -2

5
0 0
2 1
7 1
1 1
5 3


Output

NO
YES
NO
YES
NO

Note

For the hill at (2, 1) the altars can be placed at the points (1, 0), (7, 5), ( - 2, - 2), for the hill at (1, 1) — at the points (0, 0), (6, 4), ( - 3, - 1). Many other groups of three points can do the trick. There are no suitable points for other hills.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Idol implements Runnable {
    static class Point {
        final long x;
        final long y;

        Point(long x, long y) {
            this.x = x;
            this.y = y;
        }
    }

    class Polygon {
        List<Point> vertices = new ArrayList<Point>();
        List<Point> leftBorder = new ArrayList<Point>();
        List<Point> rightBorder = new ArrayList<Point>();

        void read() throws IOException {
            int n = nextInt();
            for (int i = 0; i < n; ++i) {
                int x = nextInt();
                int y = nextInt();
                vertices.add(new Point(x, y));
            }
        }

        public void prepareBorders() {
            long maxy = Long.MIN_VALUE;
            long miny = Long.MAX_VALUE;
            for (Point p : vertices) {
                miny = Math.min(miny, p.y);
                maxy = Math.max(maxy, p.y);
            }
            {
                int rightStart;
                for (rightStart = 0; rightStart < vertices.size(); ++rightStart) {
                    if (vertices.get(rightStart).y == miny && vertices.get((rightStart + 1) % vertices.size()).y > miny) {
                        break;
                    }
                }
                for (int i = rightStart;; i = (i + 1) % vertices.size()) {
                    rightBorder.add(vertices.get(i));
                    if (vertices.get(i).y == maxy)
                        break;
                }
            }
            {
                int leftStart;
                for (leftStart = 0; leftStart < vertices.size(); ++leftStart) {
                    if (vertices.get(leftStart).y == maxy && vertices.get((leftStart + 1) % vertices.size()).y < maxy) {
                        break;
                    }
                }
                for (int i = leftStart;; i = (i + 1) % vertices.size()) {
                    leftBorder.add(vertices.get(i));
                    if (vertices.get(i).y == miny)
                        break;
                }
            }
        }

        public boolean inside(Point point) {
            int rightPos;
            int leftPos;
            {
                int left = -1;
                int right = rightBorder.size();
                while (right - left > 1) {
                    int middle = (left + right) / 2;
                    if (rightBorder.get(middle).y <= point.y)
                        left = middle;
                    else
                        right = middle;
                }
                if (left < 0) return false;
                if (left == rightBorder.size() - 1) --left;
                rightPos = left;
            }
            {
                int left = -1;
                int right = leftBorder.size();
                while (right - left > 1) {
                    int middle = (left + right) / 2;
                    if (leftBorder.get(middle).y >= point.y)
                        left = middle;
                    else
                        right = middle;
                }
                if (left < 0) return false;
                if (left == leftBorder.size() - 1) --left;
                leftPos = left;
            }
            int z = 1;
            z *= signum(rightBorder.get(rightPos), point, rightBorder.get(rightPos + 1));
            z *= signum(leftBorder.get(leftPos), leftBorder.get(leftPos + 1), point);
            return z <= 0;
        }
    }

    private static int signum(Point a, Point b, Point c) {
        long dxb = b.x - a.x;
        long dyb = b.y - a.y;
        long dxc = c.x - a.x;
        long dyc = c.y - a.y;
        long z = dxb * dyc - dxc * dyb;
        if (z < 0) return -1; else if (z > 0) return 1; else return 0;
    }

    public Polygon add(Polygon a, Polygon b) {
        Polygon c = new Polygon();
        int sa = 0;
        {
            Point sap = a.vertices.get(0);
            for (int i = 1; i < a.vertices.size(); ++i) {
                Point p = a.vertices.get(i);
                if (p.y < sap.y || p.y == sap.y && p.x < sap.x) {
                    sap = p;
                    sa = i;
                }
            }
        }
        int sb = 0;
        {
            Point sbp = b.vertices.get(0);
            for (int i = 1; i < b.vertices.size(); ++i) {
                Point p = b.vertices.get(i);
                if (p.y < sbp.y || p.y == sbp.y && p.x < sbp.x) {
                    sbp = p;
                    sb = i;
                }
            }
        }
        int ra = sa;
        int rb = sb;
        while (true) {
            Point ca = a.vertices.get(sa);
            Point na = a.vertices.get((sa + 1) % a.vertices.size());
            Point cb = b.vertices.get(sb);
            Point nb = b.vertices.get((sb + 1) % b.vertices.size());
            c.vertices.add(addPoints(ca, cb));
            long dxa = na.x - ca.x;
            long dya = na.y - ca.y;
            long dxb = nb.x - cb.x;
            long dyb = nb.y - cb.y;
            long z = (dxa * dyb - dya * dxb);
            if (z > 0) {
                sa = (sa + 1) % a.vertices.size();
            } else if (z < 0) {
                sb = (sb + 1) % b.vertices.size();
            } else {
                sa = (sa + 1) % a.vertices.size();
                sb = (sb + 1) % b.vertices.size();
            }
            if (sa == ra && sb == rb)
                break;
        }
        return c;
    }

    private Point addPoints(Point ca, Point cb) {
        return new Point(ca.x + cb.x, ca.y + cb.y);
    }

    private void solve() throws IOException {
        Polygon[] p = new Polygon[3];
        for (int i = 0; i < p.length; ++i) {
            p[i] = new Polygon();
            p[i].read();
        }
        Polygon sum = p[0];
        for (int i = 1; i < p.length; ++i) {
            sum = add(sum, p[i]);
        }
        sum.prepareBorders();
        int m = nextInt();
        for (int i = 0; i < m; ++i) {
            int x = nextInt() * 3;
            int y = nextInt() * 3;
            Point pp = new Point(x, y);
            if (sum.inside(pp)) {
                writer.println("YES");
            } else {
                writer.println("NO");
            }
        }
    }

    public static void main(String[] args) {
        new Idol().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}