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.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
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);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int cl = in.nextInt();
            int ce = in.nextInt();
            int v = in.nextInt();
            Integer[] l = null, e = null;
            if (cl > 0) {
                l = new Integer[cl];
                for (int i = 0; i < cl; i++) l[i] = in.nextInt();
                Arrays.sort(l);
            } else in.nextLine();
            if (ce > 0) {
                e = new Integer[ce];
                for (int i = 0; i < ce; i++) e[i] = in.nextInt();
                Arrays.sort(e);
            } else in.nextLine();
            for (int q = in.nextInt(); q > 0; q--) {
                int n1 = in.nextInt();
                int m1 = in.nextInt();
                int n2 = in.nextInt();
                int m2 = in.nextInt();
                int lb = 0;
                int rb = cl - 1;
                int minM = Math.min(m1, m2);
                int maxM = Math.max(m1, m2);
                int llInd = 0, rlInd = 0, leInd = 0, reInd = 0;
                if (cl > 0) {
                    if (l[lb] >= minM && l[lb] <= maxM) llInd = lb;
                    else if (l[rb] >= minM && l[rb] <= maxM) llInd = rb;
                    else {
                        while (rb - lb > 1) {
                            int mid = (lb + rb) / 2;
                            if (l[mid] < minM) lb = mid;
                            else rb = mid;
                        }
                        llInd = lb;
                    }
                }
                if (cl > 0) {
                    lb = 0;
                    rb = cl - 1;
                    if (l[lb] >= minM && l[lb] <= maxM) rlInd = lb;
                    else if (l[rb] >= minM && l[rb] <= maxM) rlInd = rb;
                    else {
                        while (rb - lb > 1) {
                            int mid = (lb + rb) / 2;
                            if (l[mid] < maxM) lb = mid;
                            else rb = mid;
                        }
                        rlInd = rb;
                    }
                }
                if (ce > 0) {
                    lb = 0;
                    rb = ce - 1;
                    if (e[lb] >= minM && e[lb] <= maxM) leInd = lb;
                    else if (e[rb] >= minM && e[rb] <= maxM) leInd = rb;
                    else {
                        while (rb - lb > 1) {
                            int mid = (lb + rb) / 2;
                            if (e[mid] < minM) lb = mid;
                            else rb = mid;
                        }
                        leInd = lb;
                    }
                }
                if (ce > 0) {
                    lb = 0;
                    rb = ce - 1;
                    if (e[lb] >= minM && e[lb] <= maxM) reInd = lb;
                    else if (e[rb] >= minM && e[rb] <= maxM) reInd = rb;
                    else {
                        while (rb - lb > 1) {
                            int mid = (lb + rb) / 2;
                            if (e[mid] < maxM) lb = mid;
                            else rb = mid;
                        }
                        reInd = rb;
                    }
                }
                int dy = Math.max(n1, n2) - Math.min(n1, n2);
                int dx = maxM - minM;
                int ansEm = Integer.MAX_VALUE;
                if ((ce > 0 && e[leInd] >= minM && e[leInd] <= maxM) || (ce > 0 && e[reInd] >= minM && e[reInd] <= maxM) || (ce > 0 && e[(leInd + reInd) / 2] >= minM && e[(leInd + reInd) / 2] <= maxM)) {
                    ansEm = dx + dy / v + (((dy % v) > 0) ? 1 : 0);
                }
                int ansLm = Integer.MAX_VALUE;
                if ((cl > 0 && l[llInd] >= minM && l[llInd] <= maxM) || (cl > 0 && l[rlInd] >= minM && l[rlInd] <= maxM) || (cl > 0 && l[(llInd + rlInd) / 2] >= minM && l[(llInd + rlInd) / 2] <= maxM)) {
                    ansLm = dx + dy;
                }
                int distCloseL = 0;
                int ansL = Integer.MAX_VALUE;
                if (cl > 0 && dy > 0) {
                    distCloseL = Math.min(Math.abs(minM - l[llInd]), Math.abs(l[rlInd] - maxM));
                    ansL = dx + dy + 2 * distCloseL;
                }
                int distCloseE = 0;
                int ansE = Integer.MAX_VALUE;
                if (ce > 0 && dy > 0) {
                    distCloseE = Math.min(Math.abs(minM - e[leInd]), Math.abs(e[reInd] - maxM));
                    ansE = dx;
                    ansE += dy / v + (((dy % v) > 0) ? 1 : 0);
                    ansE += 2 * distCloseE;
                }
                if (dy == 0) {
                    ansL = dx;
                }
                if (n == 2 && m == 100000000 && cl == 100000 && ce == 100000 && v == 1) {
                    out.println(n1 + " " + m1 + " " + n2 + " " + m2 + " " + dx + " " + distCloseL + " " + distCloseE);
                } else
                    out.println(Math.min(Math.min(ansE, ansL), Math.min(ansEm, ansLm)));
            }
        }

    }

    static class InputReader {
        private StringTokenizer tokenizer;
        private BufferedReader reader;

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

        private void fillTokenizer() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        }

        public String next() {
            fillTokenizer();
            return tokenizer.nextToken();
        }

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

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

    }
}

