2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class ProblemCStairsAndElevators {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextInt(), m = in.nextInt(), cl = in.nextInt(), ce = in.nextInt(), v = in.nextInt();
            int l[] = in.nia((int) cl);
            int e[] = in.nia((int) ce);
            int q = in.nextInt();
            while (q-- > 0) {
                long x1 = in.nextInt(), y1 = in.nextInt();
                long x2 = in.nextInt(), y2 = in.nextInt();
                int li = Arrays.binarySearch(l, (int) y1);
                int ei = Arrays.binarySearch(e, (int) y1);
                if (li < 0) {
                    li = -li - 1;
                }
                if (ei < 0) {
                    ei = -ei - 1;
                }
                long ans = Long.MAX_VALUE;
                if (li == cl) {
                    if (li > 0) {
                        ans = Math.min(ans, Math.abs(y1 - l[li - 1]) + Math.abs(x2 - x1) + Math.abs(l[li - 1] - y2));
                    }
                } else {
                    if (li > 0) {
                        ans = Math.min(ans, Math.abs(y1 - l[li - 1]) + Math.abs(x2 - x1) + Math.abs(l[li - 1] - y2));
                    }
                    ans = Math.min(ans, Math.abs(y1 - l[li]) + Math.abs(x2 - x1) + Math.abs(l[li] - y2));
                }

                if (ei == ce) {
                    if (ei > 0) {
                        ans = Math.min(ans, Math.abs(y1 - e[ei - 1]) + Math.abs((Math.abs(x2 - x1) + v - 1) / v) + Math.abs(e[ei - 1] - y2));
                    }
                } else {
                    if (ei > 0) {
                        ans = Math.min(ans, Math.abs(y1 - e[ei - 1]) + Math.abs((Math.abs(x2 - x1) + v - 1) / v) + Math.abs(e[ei - 1] - y2));
                    }
                    ans = Math.min(ans, Math.abs(y1 - e[ei]) + Math.abs((Math.abs(x2 - x1) + v - 1) / v) + Math.abs(e[ei] - y2));
                }
                out.println(ans);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public int[] nia(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

