import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class Validate {
	final int MAX_X = (int) 1e8;
	final int MAX_N = (int) 1e5;
	final int MAX_DX = (int) 1e3;

	class Point implements Comparable<Point> {
		long x, y;

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

		@Override
		public int compareTo(Point o) {
			if (x == o.x)
				return Long.compare(y, o.y);
			return Long.compare(x, o.x);
		}

	}

	int vectMul(Point a, Point b, Point c) {
		return Long.signum((b.x - a.x) * 1L * (c.y - a.y) - (b.y - a.y) * 1L
				* (c.x - a.x));
	}

	Point[] convexHull(Point[] pts) {
		Arrays.sort(pts);
		Point f = pts[0], l = pts[pts.length - 1];
		ArrayList<Point> down = new ArrayList<>();
		ArrayList<Point> up = new ArrayList<>();
		for (int i = 0; i < pts.length; i++) {
			Point cur = pts[i];
			int v = vectMul(f, l, cur);
			if (v >= 0) {
				while (up.size() > 1
						&& vectMul(up.get(up.size() - 2),
								up.get(up.size() - 1), cur) >= 0) {
					up.remove(up.size() - 1);
				}
				up.add(cur);
			}
			if (v <= 0) {
				while (down.size() > 1
						&& vectMul(down.get(down.size() - 2),
								down.get(down.size() - 1), cur) <= 0) {
					down.remove(down.size() - 1);
				}
				down.add(cur);
			}
		}
		Collections.reverse(up);
		down.addAll( up.subList(1, up.size() - 1));
		Point[] res = new Point[down.size()];
		for (int i = 0; i < res.length; i++) {
			res[i] = down.get(i);
		}
		return res;
	}

	boolean isConvex(Point[] a) {
		for (int i = 0; i < a.length; i++) {
			if (vectMul(a[i], a[(i + 1) % a.length], a[(i + 2) % a.length]) < 0)
				return false;
		}
		return convexHull(a).length == a.length;
	}

	public void run() {
		StrictScanner inf = new StrictScanner(System.in);
		Point a = new Point(inf.nextInt(), inf.nextInt());
		Point b = new Point(inf.nextInt(), inf.nextInt());
		ensureLimits(a.x, -MAX_X, MAX_X, "A.x");
		ensureLimits(a.y, -MAX_X, MAX_X, "A.y");
		ensureLimits(b.x, -MAX_X, MAX_X, "B.x");
		ensureLimits(b.y, -MAX_X, MAX_X, "B.y");
		ensure(a.x != b.x || a.y != b.y, "A == B");
		inf.nextLine();

		int n = inf.nextInt();
		ensureLimits(n, 3, MAX_N, "n");
		inf.nextLine();
		Point[] pts = new Point[n];
		for (int i = 0; i < n; i++) {
			pts[i] = new Point(inf.nextInt(), inf.nextInt());
			ensureLimits(pts[i].x, -MAX_X, MAX_X, "pts[" + (i + 1) + "].x");
			ensureLimits(pts[i].y, -MAX_X, MAX_X, "pts[" + (i + 1) + "].y");
			inf.nextLine();
		}
		ensure(isConvex(pts), "polygon is convex");
		int m = inf.nextInt();
		ensureLimits(m, 0, MAX_N, "m");
		inf.nextLine();
		for (int i = 0; i < m; i++) {
			int dx = inf.nextInt(), dy = inf.nextInt();
			ensureLimits(dx, -MAX_DX, MAX_DX, "dx[" + (i + 1) + "]");
			ensureLimits(dy, -MAX_DX, MAX_DX, "dy[" + (i + 1) + "]");
			ensure(Math.abs(dx) + Math.abs(dy) > 0, "|dx| + |dy| == 0");
			inf.nextLine();
		}

		inf.close();
	}

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

	public class StrictScanner {
		private final BufferedReader in;
		private String line = "";
		private int pos;
		private int lineNo;

		public StrictScanner(InputStream source) {
			in = new BufferedReader(new InputStreamReader(source));
			nextLine();
		}

		public void close() {
			ensure(line == null, "Extra data at the end of file");
			try {
				in.close();
			} catch (IOException e) {
				throw new AssertionError("Failed to close with " + e);
			}
		}

		public void nextLine() {
			ensure(line != null, "EOF");
			ensure(pos == line.length(), "Extra characters on line " + lineNo);
			try {
				line = in.readLine();
			} catch (IOException e) {
				throw new AssertionError("Failed to read line with " + e);
			}
			pos = 0;
			lineNo++;
		}

		public String getNextLine() {
			String st = "";
			while (!isEoln()) {
				st = st + next();
			}
			return st;
		}

		public boolean isEoln() {
			return (pos == line.length());
		}

		public String next() {
			ensure(line != null, "EOF");
			ensure(line.length() > 0, "Empty line " + lineNo);
			if (pos == 0)
				ensure(line.charAt(0) > ' ', "Line " + lineNo
						+ " starts with whitespace");
			else {
				ensure(pos < line.length(), "Line " + lineNo + " is over");
				ensure(line.charAt(pos) == ' ', "Wrong whitespace on line "
						+ lineNo);
				pos++;
				ensure(pos < line.length(), "Line " + lineNo + " is over");
				ensure(line.charAt(0) > ' ', "Line " + lineNo
						+ " has double whitespace");
			}
			StringBuilder sb = new StringBuilder();
			while (pos < line.length() && line.charAt(pos) > ' ')
				sb.append(line.charAt(pos++));
			return sb.toString();
		}

		public int nextInt() {
			String s = next();
			ensure(s.length() == 1 || s.charAt(0) != '0',
					"Extra leading zero in number " + s + " on line " + lineNo);
			ensure(s.charAt(0) != '+', "Extra leading '+' in number " + s
					+ " on line " + lineNo);
			try {
				return Integer.parseInt(s);
			} catch (NumberFormatException e) {
				throw new AssertionError("Malformed number " + s + " on line "
						+ lineNo);
			}
		}

		public long nextLong() {
			String s = next();
			ensure(s.length() == 1 || s.charAt(0) != '0',
					"Extra leading zero in number " + s + " on line " + lineNo);
			ensure(s.charAt(0) != '+', "Extra leading '+' in number " + s
					+ " on line " + lineNo);
			try {
				return Long.parseLong(s);
			} catch (NumberFormatException e) {
				throw new AssertionError("Malformed number " + s + " on line "
						+ lineNo);
			}
		}

		public double nextDouble() {
			String s = next();
			ensure(s.length() == 1 || s.startsWith("0.") || s.charAt(0) != '0',
					"Extra leading zero in number " + s + " on line " + lineNo);
			ensure(s.charAt(0) != '+', "Extra leading '+' in number " + s
					+ " on line " + lineNo);
			try {
				return Double.parseDouble(s);
			} catch (NumberFormatException e) {
				throw new AssertionError("Malformed number " + s + " on line "
						+ lineNo);
			}
		}
	}

	public static class Geometry {
		/**
		 * Distance between two points (x1; y1) and (x2; y2)
		 */
		public static double dist(int x1, int y1, int x2, int y2) {
			long x3 = x1;
			long y3 = y1;
			long x4 = x2;
			long y4 = y2;
			return Math.sqrt((x3 - x4) * (x3 - x4) + (y3 - y4) * (y3 - y4));
		}
	}

	public static class Graph {
		/**
		 * Adjacency matrix 0 or -1 if edge is empty other positive int if not
		 */
		private static boolean dfsCheckForTree(int k, int p, boolean[] f,
				int[][] e) {
			f[k] = true;
			for (int i = 0; i < f.length; i++) {
				if (e[k][i] > 0 && !f[i]) {
					dfsCheckForTree(i, k, f, e);
				} else {
					if (e[k][i] > 0 && f[i] && i != p) {
						return false;
					}
				}
			}
			return true;
		}

		public static boolean isTree(int[][] e) {
			for (int i = 0; i < e.length; i++) {
				ensure(e[i].length == e.length,
						"Bad adjacency matrix given to class Graph");
			}
			ensure(e.length != 0, "Empty adjacency matrix given to class Graph");
			boolean[] visited = new boolean[e.length];
			if (!dfsCheckForTree(0, -1, visited, e))
				;
			boolean ans = true;
			for (int i = 0; i < e.length; i++) {
				ans &= visited[i];
			}
			return ans;
		}
	}

	static void ensure(boolean b, String message) {
		if (!b) {
			throw new AssertionError(message);
		}
	}

	void ensureString(String s, String alph, String text) {
		for (int i = 0; i < s.length(); i++) {
			ensure(alph.indexOf(s.charAt(i)) != -1, text);
		}
	}

	void ensureLimits(long n, long from, long to, String name) {
		ensure(from <= n && n <= to, name + " must be from " + from + " to "
				+ to);
	}

	void ensureLimits(int n, int from, int to, String name) {
		ensure(from <= n && n <= to, name + " must be from " + from + " to "
				+ to);
	}

	String line(int x) {
		return "Problem in line #" + Integer.toString(x);
	}

}
