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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.io.BufferedOutputStream;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author An Almost Retired Guy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        MogohuReaIdol solver = new MogohuReaIdol();
        solver.solve(1, in, out);
        out.close();
    }

    static class MogohuReaIdol {
        void add(TreeSet<Point> set, Point point) {
            Point l = set.lower(point);
            if (l == null) set.add(point);
            else {
                Point r = set.higher(point);
                if (r == null || l.ccw(point, r)) set.add(point);
                else return;
            }
            l = set.lower(point);
            if (l != null) while (true) {
                Point ll = set.lower(l);
                if (ll == null || ll.ccw(l, point)) break;
                set.remove(l);
                l = ll;
            }
            Point r = set.higher(point);
            if (r == null) return;
            while (true) {
                Point rr = set.higher(r);
                if (rr == null || point.ccw(r, rr)) break;
                set.remove(r);
                r = rr;
            }
        }

        boolean test(TreeSet<Point> set, Point point) {
            if (set.contains(point)) return true;
            Point l = set.lower(point);
            if (l == null) return false;
            Point r = set.higher(point);
            if (r == null) return false;
            return !l.ccw(point, r);
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Point[] sum = minkowskiSum(minkowskiSum(readPolygon(in), readPolygon(in)), readPolygon(in));
            Point[] query = readPolygon(in);
            for (int i = 0; i < query.length; i++) query[i] = query[i].mul(3);
            TreeSet<Point> lower = new TreeSet<>(), upper = new TreeSet<>((i, j) -> j.compareTo(i));
            for (Point P : sum) {
                add(lower, P);
                add(upper, P);
            }
            for (Point P : query) {
                boolean ans = test(lower, P) && test(upper, P);
                out.println(ans ? "YES" : "NO");
            }
        }

        Point[] minkowskiSum(Point[] A, Point[] B) {
            int idxA = 0, idxB = 0;
            for (int i = 1; i < A.length; i++) if (A[i].compareTo(A[idxA]) < 0) idxA = i;
            for (int i = 1; i < B.length; i++) if (B[i].compareTo(B[idxB]) < 0) idxB = i;
            Point[] ans = new Point[A.length + B.length];
            Point P = A[idxA].add(B[idxB]);
            for (int i = 0, j = 0; i < A.length || j < B.length; ) {
                ans[i + j] = P;
                int I = idxA + i, J = idxB + j;
                Point U = new Point(A[I % A.length], A[(I + 1) % A.length]), V = new Point(B[J % B.length], B[(J + 1) % B.length]);
                if (j == B.length || (i < A.length && U.cross(V) >= 0)) {
                    P = P.add(U);
                    i++;
                } else {
                    P = P.add(V);
                    j++;
                }
            }
            return ans;
        }

        Point[] readPolygon(InputReader in) {
            int n = in.nextInt();
            Point[] ans = new Point[n];
            for (int i = 0; i < n; i++) ans[i] = new Point(in.nextInt(), in.nextInt());
            return ans;
        }

        class Point extends ConvexHull.Point implements Comparable<Point> {
            Point(int x, int y) {
                super(x, y);
            }

            Point(Point A, Point B) {
                this(B.x - A.x, B.y - A.y);
            }


            public int compareTo(Point that) {
                int cmp = Integer.compare(this.x, that.x);
                if (cmp != 0) return cmp;
                return Integer.compare(this.y, that.y);
            }

            long cross(Point that) {
                return (long) this.x * that.y - (long) this.y * that.x;
            }

            Point add(Point that) {
                return new Point(this.x + that.x, this.y + that.y);
            }

            Point mul(int factor) {
                return new Point(x * factor, y * factor);
            }

            boolean ccw(Point A, Point B) {
                Point U = new Point(A.x - x, A.y - y), V = new Point(B.x - x, B.y - y);
                long cross = (long) U.x * V.y - (long) U.y * V.x;
                return cross > 0;
            }

        }

    }

    static class ConvexHull {
        public static class Point {
            public final int x;
            public final int y;

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

        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(new BufferedOutputStream(outputStream));
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public void close() {
            super.close();
        }

    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

    }
}